diff options
| author | Guillaume Nault <g.nault@alphalink.fr> | 2013-01-07 20:01:26 +0100 |
|---|---|---|
| committer | Kozlov Dmitry <xeb@mail.ru> | 2013-01-11 16:24:14 +0400 |
| commit | 3a68b66387b2e352d4ffe60c0dd4aeeb2c599fb4 (patch) | |
| tree | c4a2a5659f1d6f15032291465101130e0085b366 /accel-pppd/ctrl | |
| parent | 98466f59d258d2079755d2a1808cd34631d9f230 (diff) | |
| download | accel-ppp-3a68b66387b2e352d4ffe60c0dd4aeeb2c599fb4.tar.gz accel-ppp-3a68b66387b2e352d4ffe60c0dd4aeeb2c599fb4.zip | |
Fix boolean options parsing in configuration file
Explicitely interpret zero values when parsing boolean options. This
allows to unset boolean parameters such as "verbose" when reloading
the configuration.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ctrl')
| -rw-r--r-- | accel-pppd/ctrl/l2tp/l2tp.c | 8 | ||||
| -rw-r--r-- | accel-pppd/ctrl/pptp/pptp.c | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index 3a7c15f5..599fc4c4 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -1201,12 +1201,12 @@ static void load_config(void) const char *opt; opt = conf_get_opt("l2tp", "verbose"); - if (opt && atoi(opt) > 0) - conf_verbose = 1; + if (opt && atoi(opt) >= 0) + conf_verbose = atoi(opt) > 0; opt = conf_get_opt("l2tp", "avp_permissive"); - if (opt && atoi(opt) > 0) - conf_avp_permissive = 1; + if (opt && atoi(opt) >= 0) + conf_avp_permissive = atoi(opt) > 0; opt = conf_get_opt("l2tp", "hello-interval"); if (opt && atoi(opt) > 0) diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c index a3476c5e..ce7b13df 100644 --- a/accel-pppd/ctrl/pptp/pptp.c +++ b/accel-pppd/ctrl/pptp/pptp.c @@ -743,9 +743,9 @@ static void load_config(void) conf_echo_failure = atoi(opt); opt = conf_get_opt("pptp", "verbose"); - if (opt && atoi(opt) > 0) - conf_verbose = 1; - + if (opt && atoi(opt) >= 0) + conf_verbose = atoi(opt) > 0; + conf_mppe = MPPE_UNSET; opt = conf_get_opt("pptp", "mppe"); if (opt) { |
