diff options
| author | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-08-09 07:15:43 +0300 |
|---|---|---|
| committer | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-08-09 08:58:08 +0300 |
| commit | a9f666ea84927427a27261b81aa77435d4296d28 (patch) | |
| tree | b8dd361ba6e98852f8756ec56c1b0adab00c0d48 | |
| parent | d76b2f6c6b8f2c510fae5beb24e261901a221d3c (diff) | |
| download | accel-ppp-a9f666ea84927427a27261b81aa77435d4296d28.tar.gz accel-ppp-a9f666ea84927427a27261b81aa77435d4296d28.zip | |
pptp: make echo-failure=0 disable the check explicitly
load_config() accepts echo-failure=0, but the test for it was
"++echo_sent == conf_echo_failure", which can never match once the
counter has been incremented, so a zero left dead peers undetected
without saying so anywhere. Test the option first and compare with >=,
which keeps the behaviour for every configured value and makes the
disabled case readable, and document it in accel-ppp.conf.5.
| -rw-r--r-- | accel-pppd/accel-ppp.conf.5 | 2 | ||||
| -rw-r--r-- | accel-pppd/ctrl/pptp/pptp.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5 index bcddfed4..de900edd 100644 --- a/accel-pppd/accel-ppp.conf.5 +++ b/accel-pppd/accel-ppp.conf.5 @@ -709,7 +709,7 @@ If this option is given and greater than zero then pptp module will send echo-re seconds. .TP .BI "echo-failure=" n -Specifies maximum number of echo-requests may be sent without valid echo-reply, if exceeds connection will be terminated. +Specifies maximum number of echo-requests may be sent without valid echo-reply, if exceeds connection will be terminated. Zero disables the check: echo-requests are still sent, but missing replies never terminate the connection (default 3). .TP .BI "timeout=" n Timeout waiting reply from client in seconds (default 5). diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c index b55260ba..6b00666e 100644 --- a/accel-pppd/ctrl/pptp/pptp.c +++ b/accel-pppd/ctrl/pptp/pptp.c @@ -508,7 +508,7 @@ static void pptp_send_echo(struct triton_timer_t *t) .header = PPTP_HEADER_CTRL(PPTP_ECHO_RQST), }; - if (++conn->echo_sent == conf_echo_failure) { + if (conf_echo_failure && ++conn->echo_sent >= conf_echo_failure) { log_ppp_warn("pptp: no echo reply\n"); disconnect(conn); return; |
