ppp
ppp copied to clipboard
pppstats IN counter sometimes displays 0
While I'm still investigating my issue of even if the lcp-echo-adaptive is set, sometimes pppd terminates the connection with "Peer not responding" when the line is saturated, I noticed that pppstats sometimes displays 0 in the IN column.
Digging into the code I noticed a few things:
- the
pppstatstruct stores everything in __u32, and although it seems these are the in-kernel values too (include/uapi/linux/ppp_defs.h) it is very small for todays traffic. One can wrap that number around very fast in merely minutes or seconds at least for theppp_ibytesdefinitely. - when printing the number you are casting an unsigned int back to signed int here: https://github.com/ppp-project/ppp/blob/master/pppstats/pppstats.c#L267, so every time the
ppp_ibytes> 2147483647, it will print 0.
(unfortunately these findings don't explain my original issue, since in https://github.com/ppp-project/ppp/blob/master/pppd/lcp.c#L2279 even if the pkts_in wraps around, that expression will almost always be true if there were some traffic)
@paulusmack: Have you seen this ticket?
@Neustradamus this might be addressed by https://github.com/ppp-project/ppp/pull/298 indirectly?
@electrofloat: Have you looked the last comment?
@Neustradamus Yes, it seems that is would resolve this issue, so I'm closing this one, thanks.
@electrofloat: Nice, thanks for your confirmation!
Thanks @jkroonza!