diff options
author | Brian Somers <brian@FreeBSD.org> | 1998-03-13 21:07:14 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 1998-03-13 21:07:14 +0000 |
commit | a611cad61ddd580230399f0ef61f637a208345fb (patch) | |
tree | 70bec5b6d42195bdd0df5964a7552cdc066f0473 /usr.sbin/ppp/lqr.c | |
parent | 2c995c533218e8be2ba869a3ce744e70c37bc308 (diff) | |
download | src-a611cad61ddd580230399f0ef61f637a208345fb.tar.gz src-a611cad61ddd580230399f0ef61f637a208345fb.zip |
o Don't immediately reply to the first LQR thinking
it's a duplicate ('cos it compares with our initial
values).
o Move the LCP into struct datalink.
Notes
Notes:
svn path=/cvs2svn/branches/MP/; revision=34556
Diffstat (limited to 'usr.sbin/ppp/lqr.c')
-rw-r--r-- | usr.sbin/ppp/lqr.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.sbin/ppp/lqr.c b/usr.sbin/ppp/lqr.c index 10ef1aa2065b..94d6a35ed575 100644 --- a/usr.sbin/ppp/lqr.c +++ b/usr.sbin/ppp/lqr.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: lqr.c,v 1.22.2.9 1998/03/13 00:44:10 brian Exp $ + * $Id: lqr.c,v 1.22.2.10 1998/03/13 00:44:56 brian Exp $ * * o LQR based on RFC1333 * @@ -127,7 +127,7 @@ SendLqrReport(void *v) LogPrintf(LogPHASE, "** Too many LQR packets lost **\n"); LogPrintf(LogLQM, "LqrOutput: Too many LQR packets lost\n"); hdlc->lqm.method = 0; /* Prevent recursion via bundle_Close() */ - bundle_Close(LcpInfo.fsm.bundle, NULL, 1); + bundle_Close(lcp->fsm.bundle, NULL, 1); } else { bp = mballoc(sizeof(struct lqrdata), MB_LQR); HdlcOutput(lcp->fsm.link, PRI_LINK, PROTO_LQR, bp); @@ -141,7 +141,7 @@ SendLqrReport(void *v) LogPrintf(LogPHASE, "** Too many ECHO LQR packets lost **\n"); LogPrintf(LogLQM, "LqrOutput: Too many ECHO LQR packets lost\n"); hdlc->lqm.method = 0; /* Prevent recursion via bundle_Close() */ - bundle_Close(LcpInfo.fsm.bundle, NULL, 1); + bundle_Close(lcp->fsm.bundle, NULL, 1); } else SendEchoReq(lcp); } @@ -161,15 +161,17 @@ LqrInput(struct physical *physical, struct mbuf *bp) else if (!Acceptable(ConfLqr)) { bp->offset -= 2; bp->cnt += 2; - LcpSendProtoRej(MBUF_CTOP(bp), bp->cnt); + lcp_SendProtoRej(physical->hdlc.lqm.owner, MBUF_CTOP(bp), bp->cnt); } else { struct lqrdata *lqr; + struct lcp *lcp; u_int32_t lastLQR; lqr = (struct lqrdata *)MBUF_CTOP(bp); - if (ntohl(lqr->MagicNumber) != LcpInfo.his_magic) + lcp = physical->hdlc.lqm.owner; + if (ntohl(lqr->MagicNumber) != physical->hdlc.lqm.owner->his_magic) LogPrintf(LogERROR, "LqrInput: magic %x != expecting %x\n", - ntohl(lqr->MagicNumber), LcpInfo.his_magic); + ntohl(lqr->MagicNumber), physical->hdlc.lqm.owner->his_magic); else { /* * Remember our PeerInLQRs, then convert byte order and save @@ -188,7 +190,7 @@ LqrInput(struct physical *physical, struct mbuf *bp) * send our next one before the peers max timeout. */ if (physical->hdlc.lqm.timer.load == 0 || - lastLQR == physical->hdlc.lqm.lqr.peer.PeerInLQRs || + (lastLQR && lastLQR == physical->hdlc.lqm.lqr.peer.PeerInLQRs) || (physical->hdlc.lqm.lqr.peer_timeout && physical->hdlc.lqm.timer.rest * 100 / SECTICKS > physical->hdlc.lqm.lqr.peer_timeout)) |