diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2014-01-19 21:01:21 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-01-19 21:03:52 +0400 |
commit | b02e7ad2059416b2d8b1b4e6e8c12132ed4a6cc3 (patch) | |
tree | 2cddaf7019f1adff3e94fa58f23bb37262f4d731 /accel-pppd | |
parent | 2ee198430cfc5c6cbf99b5110ebd212d64f22ef0 (diff) | |
download | accel-ppp-xebd-b02e7ad2059416b2d8b1b4e6e8c12132ed4a6cc3.tar.gz accel-ppp-xebd-b02e7ad2059416b2d8b1b4e6e8c12132ed4a6cc3.zip |
ippool: add support for old style pool name declaration
Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/accel-ppp.conf | 6 | ||||
-rw-r--r-- | accel-pppd/accel-ppp.conf.5 | 10 | ||||
-rw-r--r-- | accel-pppd/extra/ippool.c | 12 |
3 files changed, 20 insertions, 8 deletions
diff --git a/accel-pppd/accel-ppp.conf b/accel-pppd/accel-ppp.conf index 644ebea..a5f7e80 100644 --- a/accel-pppd/accel-ppp.conf +++ b/accel-pppd/accel-ppp.conf @@ -157,9 +157,9 @@ gw-ip-address=192.168.0.1 #attr=Cisco-AVPair attr=Framed-Pool 192.168.0.2-255 -192.168.1.1-255,pool1 -192.168.2.1-255,pool2 -192.168.3.1-255,pool3 +192.168.1.1-255,name=pool1 +192.168.2.1-255,name=pool2 +192.168.3.1-255,name=pool3 192.168.4.0/24 [log] diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5 index 73a3233..01ca869 100644 --- a/accel-pppd/accel-ppp.conf.5 +++ b/accel-pppd/accel-ppp.conf.5 @@ -722,20 +722,20 @@ Specifies single IP address to be used as local address of ppp interfaces. .BI "gw=" range Specifies range of local address of ppp interfaces if form: .br -.B x.x.x.x/mask[,pool_name] +.B x.x.x.x/mask[,name=pool_name] (for example 10.0.0.0/8) .br -.B x.x.x.x-y[,pool_name] +.B x.x.x.x-y[,name=pool_name] (for example 10.0.0.1-254) .TP .BI "tunnel=" range Specifies range of remote address of ppp interfaces if form: .br -.B x.x.x.x/mask[,pool_name] +.B x.x.x.x/mask[,name=pool_name] .br -.B x.x.x.x-y[,pool_name] +.B x.x.x.x-y[,name=pool_name] .TP -.BI "x.x.x.x/mask[,pool_name] or x.x.x.x-y[,pool_name]" +.BI "x.x.x.x/mask[,name=pool_name] or x.x.x.x-y[,name=pool_name]" Also specifies range of remote address of ppp interfaces. .TP .BI "attr=" attribute diff --git a/accel-pppd/extra/ippool.c b/accel-pppd/extra/ippool.c index 2790183..825b8f3 100644 --- a/accel-pppd/extra/ippool.c +++ b/accel-pppd/extra/ippool.c @@ -487,6 +487,18 @@ static void parse_options(const char *opt, char **pool_name, char **allocator) memcpy(*allocator, ptr1 + 10, len); (*allocator)[len] = 0; } + + if (!*pool_name) { + ptr1 = strchr(opt, ','); + if (!ptr1) + return; + + for (ptr2 = ptr1 + 1; *ptr2 && *ptr2 != '='; ptr2++); + if (*ptr2 == '=') + return; + + *pool_name = _strdup(ptr1 + 1); + } } static void ippool_init1(void) |