[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #51897] PPP Stats Support in LCP
From: |
G Smith |
Subject: |
[lwip-devel] [bug #51897] PPP Stats Support in LCP |
Date: |
Wed, 30 Aug 2017 12:55:43 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko |
URL:
<http://savannah.nongnu.org/bugs/?51897>
Summary: PPP Stats Support in LCP
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: gsmith
Submitted on: Wed 30 Aug 2017 04:55:41 PM UTC
Category: PPP
Severity: 3 - Normal
Item Group: Compiler Warning
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
lwIP version: 2.0.2
_______________________________________________________
Details:
I have recently enabled the PPP_LCP_ADAPTIVE feature to test it out, as I'm
having problems with one of the peers responding to echo requests. Anyhow, in
lcp.c, around line 2744, the compiler complains that 'link_stats' is
undeclared. I think this is because I don' t have PPP_STATS_SUPPORT enabled
and the #endif is not encompassing the next few lines as it should.
Please see the original code and my fix below. (I'm running Lwip 2.0.2.)
The offending code is this:
#if PPP_LCP_ADAPTIVE
/*
* If adaptive echos have been enabled, only send the echo request if
* no traffic was received since the last one.
*/
if (pcb->settings.lcp_echo_adaptive) {
static unsigned int last_pkts_in = 0;
#if PPP_STATS_SUPPORT
update_link_stats(f->unit);
link_stats_valid = 0;
#endif /* PPP_STATS_SUPPORT */
if (link_stats.pkts_in != last_pkts_in) {
last_pkts_in = link_stats.pkts_in;
return;
}
}
#endif
My fix is to move the PPP_STATS_SUPPORT #endif down 5 lines:
#if PPP_LCP_ADAPTIVE
/*
* If adaptive echos have been enabled, only send the echo request if
* no traffic was received since the last one.
*/
if (pcb->settings.lcp_echo_adaptive) {
static unsigned int last_pkts_in = 0;
#if PPP_STATS_SUPPORT
update_link_stats(f->unit);
link_stats_valid = 0;
if (link_stats.pkts_in != last_pkts_in) {
last_pkts_in = link_stats.pkts_in;
return;
}
#endif /* PPP_STATS_SUPPORT */
}
#endif
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?51897>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #51897] PPP Stats Support in LCP,
G Smith <=