From: Paul Mackerras Date: Tue, 29 Dec 2020 03:10:40 +0000 (+1100) Subject: Merge pull request #165 from pali/lcp X-Git-Tag: ppp-2.4.9~47 X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=505ec5cbd15ec23ed84282462ae9e451a1978133;hp=2b4166d02ed0e5dd74d37e2229805ccfd3dc23e0;p=ppp.git Merge pull request #165 from pali/lcp pppd: Do not call update_link_stats() for every LcpSendEchoRequest() call --- diff --git a/pppd/lcp.c b/pppd/lcp.c index 902b64a..d7ea471 100644 --- a/pppd/lcp.c +++ b/pppd/lcp.c @@ -2339,12 +2339,10 @@ LcpSendEchoRequest (f) */ if (lcp_echo_adaptive) { static unsigned int last_pkts_in = 0; + struct pppd_stats cur_stats; - update_link_stats(f->unit); - link_stats_valid = 0; - - if (link_stats.pkts_in != last_pkts_in) { - last_pkts_in = link_stats.pkts_in; + if (get_ppp_stats(f->unit, &cur_stats) && cur_stats.pkts_in != last_pkts_in) { + last_pkts_in = cur_stats.pkts_in; return; } }