Wed 30 Aug 2017 04:55:41 PM UTC, original submission:
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
|