summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/pptp/pptp.c
diff options
context:
space:
mode:
authorDenys Fedoryshchenko <denys.f@collabora.com>2026-08-09 07:15:43 +0300
committerDenys Fedoryshchenko <denys.f@collabora.com>2026-08-09 08:58:08 +0300
commita9f666ea84927427a27261b81aa77435d4296d28 (patch)
treeb8dd361ba6e98852f8756ec56c1b0adab00c0d48 /accel-pppd/ctrl/pptp/pptp.c
parentd76b2f6c6b8f2c510fae5beb24e261901a221d3c (diff)
downloadaccel-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.
Diffstat (limited to 'accel-pppd/ctrl/pptp/pptp.c')
-rw-r--r--accel-pppd/ctrl/pptp/pptp.c2
1 files changed, 1 insertions, 1 deletions
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;