diff options
author | brian <brian@FreeBSD.org> | 1998-03-12 02:23:42 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1998-03-12 02:23:42 +0000 |
commit | a8479404200bfc50e062e281337d95b91d6a9a75 (patch) | |
tree | 96c444d4e63628df31d0714b1d5172c8979882f4 /usr.sbin/ppp/hdlc.c | |
parent | 279390da0fed6c4baa132126919daedde8bcd717 (diff) | |
download | FreeBSD-src-a8479404200bfc50e062e281337d95b91d6a9a75.zip FreeBSD-src-a8479404200bfc50e062e281337d95b91d6a9a75.tar.gz |
o Fix a few comment typos.
o Fix ``set timeout'' usage message and documentation.
o Change ifOutPackets, ifOutOctets and ifOutLQRs to `u_int32_t's
so that they wrap correctly.
o Put the LQR in network byte order using the correct struct size
(sizeof u_int32_t, not sizeof u_long).
o Wrap LQR ECHO counters correctly.
o Don't increment OutLQR count if the last LQR hasn't been replied
to.
o Initialise HisLqrData (last received LQR) in StartLqm.
o Don't start the LQR timer if we're `disabled' and `accepted'.
o Generate LQR responses when both sides are using a timer and
we're not going to send our next LQR before the peers max timeout.
LQR should now be fully functional.
Diffstat (limited to 'usr.sbin/ppp/hdlc.c')
-rw-r--r-- | usr.sbin/ppp/hdlc.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/usr.sbin/ppp/hdlc.c b/usr.sbin/ppp/hdlc.c index ca51a64..f88d899 100644 --- a/usr.sbin/ppp/hdlc.c +++ b/usr.sbin/ppp/hdlc.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: hdlc.c,v 1.27 1998/01/10 01:55:10 brian Exp $ + * $Id: hdlc.c,v 1.28 1998/01/21 02:15:15 brian Exp $ * * TODO: */ @@ -56,9 +56,9 @@ static struct hdlcstat { int unknownproto; } HdlcStat; -static int ifOutPackets; -static int ifOutOctets; -static int ifOutLQRs; +static u_int32_t ifOutPackets; +static u_int32_t ifOutOctets; +static u_int32_t ifOutLQRs; static struct protostat { u_short number; @@ -216,8 +216,17 @@ HdlcOutput(int pri, u_short proto, struct mbuf * bp) lqr->PeerInDiscards = HisLqrSave.SaveInDiscards; lqr->PeerInErrors = HisLqrSave.SaveInErrors; lqr->PeerInOctets = HisLqrSave.SaveInOctets; - lqr->PeerOutLQRs = ++ifOutLQRs; - LqrDump("LqrOutput", lqr); + if (HisLqrData.LastOutLQRs == ifOutLQRs) { + /* + * only increment if it's the first time or we've got a reply + * from the last one + */ + lqr->PeerOutLQRs = ++ifOutLQRs; + LqrDump("LqrOutput", lqr); + } else { + lqr->PeerOutLQRs = ifOutLQRs; + LqrDump("LqrOutput (again)", lqr); + } LqrChangeOrder(lqr, (struct lqrdata *) (MBUF_CTOP(bp))); } if (!DEV_IS_SYNC) { |