diff options
Diffstat (limited to 'ggsn/ggsn.c')
-rw-r--r-- | ggsn/ggsn.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 1b7911c..2ab0e43 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -565,23 +565,24 @@ int main(int argc, char **argv) } /* dynip */ + struct in46_prefix i46p; + size_t prefixlen; if (!args_info.dynip_arg) { - if (ippool_new(&ippool, args_info.net_arg, NULL, 1, 0, - IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | - IPPOOL_NOBROADCAST)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to allocate IP pool!"); + if (ippool_aton(&i46p.addr, &prefixlen, args_info.net_arg, 0)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); exit(1); } } else { - if (ippool_new(&ippool, args_info.dynip_arg, NULL, 1, 0, - IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | - IPPOOL_NOBROADCAST)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to allocate IP pool!"); + if (ippool_aton(&i46p.addr, &prefixlen, args_info.dynip_arg, 0)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); exit(1); } } + i46p.prefixlen = prefixlen; + if (ippool_new(&ippool, &i46p, NULL, IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | IPPOOL_NOBROADCAST)) { + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to allocate IP pool!"); + exit(1); + } /* DNS1 and DNS2 */ memset(&dns1, 0, sizeof(dns1)); |