diff options
author | xebd <xeb@mail.ru> | 2019-08-29 16:26:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-29 16:26:51 +0300 |
commit | e8d62dcc82f356f1a5a76adefbc786d5a99445be (patch) | |
tree | 953f37451ed51e16cb8f662270e3f730c3edb639 /accel-pppd | |
parent | 7efdbf43b172abe58e703d09fc8f317bf0da0000 (diff) | |
parent | 9176c3c67a70a7451aed2ed444c942d30f600a07 (diff) | |
download | accel-ppp-e8d62dcc82f356f1a5a76adefbc786d5a99445be.tar.gz accel-ppp-e8d62dcc82f356f1a5a76adefbc786d5a99445be.zip |
Merge pull request #98 from themiron/check-ip-cleanup
ppp/ipoe: cleanup cleck-ip support
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/accel-ppp.conf.5 | 2 | ||||
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 6 | ||||
-rw-r--r-- | accel-pppd/ppp/ipcp_opt_ipaddr.c | 13 | ||||
-rw-r--r-- | accel-pppd/ppp/ipv6cp_opt_intfid.c | 2 |
4 files changed, 12 insertions, 11 deletions
diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5 index 6533ef59..3ac7511b 100644 --- a/accel-pppd/accel-ppp.conf.5 +++ b/accel-pppd/accel-ppp.conf.5 @@ -124,7 +124,7 @@ Path to file for sessions sequence number. Start sequence number may be set ther Specifies maximum sessions which server may processed (default 0, disabled) .TP .BI "check-ip=" 0|1 -Specifies whether accel-ppp should check if IP already assigned to other ppp interface (default 0). +Specifies whether accel-ppp should check if IP already assigned to other client interface (default 0). .SH [ppp] .br PPP module configuration. diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 9880162c..1316b615 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -3954,8 +3954,10 @@ static void load_config(void) else conf_weight = 0; - opt = conf_get_opt("common", "check-ip"); - if (opt && atoi(opt) >= 0) + opt = conf_get_opt("ipoe", "check-ip"); + if (!opt) + opt = conf_get_opt("common", "check-ip"); + if (opt && opt >= 0) conf_check_exists = atoi(opt) > 0; #ifdef RADIUS diff --git a/accel-pppd/ppp/ipcp_opt_ipaddr.c b/accel-pppd/ppp/ipcp_opt_ipaddr.c index 03eb418f..5656c813 100644 --- a/accel-pppd/ppp/ipcp_opt_ipaddr.c +++ b/accel-pppd/ppp/ipcp_opt_ipaddr.c @@ -171,14 +171,11 @@ static void load_config(void) { const char *opt; - opt = conf_get_opt("common", "check-ip"); - if (opt && atoi(opt) > 0) - conf_check_exists = atoi(opt); - else { - opt = conf_get_opt("ppp", "check-ip"); - if (opt && atoi(opt) >= 0) - conf_check_exists = atoi(opt) > 0; - } + opt = conf_get_opt("ppp", "check-ip"); + if (!opt) + opt = conf_get_opt("common", "check-ip"); + if (opt && atoi(opt) >= 0) + conf_check_exists = atoi(opt) > 0; } static void ipaddr_opt_init() diff --git a/accel-pppd/ppp/ipv6cp_opt_intfid.c b/accel-pppd/ppp/ipv6cp_opt_intfid.c index 4f019b63..bc7fae89 100644 --- a/accel-pppd/ppp/ipv6cp_opt_intfid.c +++ b/accel-pppd/ppp/ipv6cp_opt_intfid.c @@ -317,6 +317,8 @@ static void load_config(void) const char *opt; opt = conf_get_opt("ppp", "check-ip"); + if (!opt) + opt = conf_get_opt("common", "check-ip"); if (opt && atoi(opt) >= 0) conf_check_exists = atoi(opt) > 0; |