]> git.ozlabs.org Git - ppp.git/commitdiff
pppd: Fix spurious LCP echo failures with lcp-echo-adaptive option
authorPaul Mackerras <paulus@ozlabs.org>
Mon, 5 Dec 2022 06:33:48 +0000 (17:33 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Mon, 5 Dec 2022 06:33:48 +0000 (17:33 +1100)
If the lcp-echo-adaptive option is specified, it means that seeing
received traffic on the link is considered to be an indication that
the link is working.  Hence, this resets the count of missing LCP
echo-replies to 0 when traffic is seen.  Without this, occasional
echo failures interspersed with link traffic can accumulate and end up
causing a disconnection even when the link is working correctly.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
pppd/lcp.c

index 9dc883e47ce85a634df6c42b884a512379bd3559..6354f397f0084f8d215c4ded2b1eb022043b2a5f 100644 (file)
@@ -2279,6 +2279,8 @@ LcpSendEchoRequest (fsm *f)
 
        if (get_ppp_stats(f->unit, &cur_stats) && cur_stats.pkts_in != last_pkts_in) {
            last_pkts_in = cur_stats.pkts_in;
+           /* receipt of traffic indicates the link is working... */
+           lcp_echos_pending = 0;
            return;
        }
     }