diff options
author | Vladislav Grishenko <themiron@mail.ru> | 2019-08-29 17:33:07 +0500 |
---|---|---|
committer | Vladislav Grishenko <themiron@mail.ru> | 2019-08-29 17:33:07 +0500 |
commit | 9176c3c67a70a7451aed2ed444c942d30f600a07 (patch) | |
tree | 66eb33b9d2531093cb28221d2266a450b593473a /accel-pppd/ppp | |
parent | 101c413b15f6503d37b3f70d45094c3b2a604f14 (diff) | |
download | accel-ppp-9176c3c67a70a7451aed2ed444c942d30f600a07.tar.gz accel-ppp-9176c3c67a70a7451aed2ed444c942d30f600a07.zip |
ppp/ipoe: cleanup cleck-ip support
let check-ip setting from [ppp]/[ipoe] sections has prio over [common]
for compatibility with older configs.
Diffstat (limited to 'accel-pppd/ppp')
-rw-r--r-- | accel-pppd/ppp/ipcp_opt_ipaddr.c | 13 | ||||
-rw-r--r-- | accel-pppd/ppp/ipv6cp_opt_intfid.c | 2 |
2 files changed, 7 insertions, 8 deletions
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; |