diff options
author | brian <brian@cvs.openbsd.org> | 1999-06-03 13:50:54 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1999-06-03 13:50:54 +0000 |
commit | 87f94b3339abf62e3a76f90b9f10d34db816a17b (patch) | |
tree | ee99ddab93b871198f6df46a5464a273315933a8 /usr.sbin | |
parent | 9c13b589a2f7ab2f67f75a36293560b3bda30928 (diff) |
Fix some MP sequence number comparison bogons that are tickled by
having different speed links in a bundle. This would manifest itself
by having the link occasionally hang, but revive when a new connection
is made....
Make ``show mp'' a bit prettier.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/ppp/mp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/ppp/ppp/mp.c b/usr.sbin/ppp/ppp/mp.c index a49bdf8aed5..a87e03715f9 100644 --- a/usr.sbin/ppp/ppp/mp.c +++ b/usr.sbin/ppp/ppp/mp.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp.c,v 1.9 1999/06/02 23:06:59 brian Exp $ + * $Id: mp.c,v 1.10 1999/06/03 13:50:53 brian Exp $ */ #include <sys/param.h> @@ -405,7 +405,7 @@ mp_Assemble(struct mp *mp, struct mbuf *m, struct physical *p) if (h.seq != seq) { /* we're missing something :-( */ - if (mp->seq.min_in > seq) { + if (isbefore(mp->local_is12bit, seq, mp->seq.min_in)) { /* we're never gonna get it */ struct mbuf *next; @@ -433,7 +433,8 @@ mp_Assemble(struct mp *mp, struct mbuf *m, struct physical *p) log_Printf(LogDEBUG, "Drop frag %u\n", h.seq); mbuf_Free(mp->inbufs); mp->inbufs = next; - } while (mp->inbufs && (h.seq >= mp->seq.min_in || h.end)); + } while (mp->inbufs && (isbefore(mp->local_is12bit, mp->seq.min_in, + h.seq) || h.end)); /* * Continue processing things from here. @@ -569,7 +570,7 @@ mp_Output(struct mp *mp, struct bundle *bundle, struct link *l, } if (log_IsKept(LogDEBUG)) log_Printf(LogDEBUG, "MP[frag %d]: Send %d bytes on link `%s'\n", - mp->out.seq, mbuf_Length(mo), l->name); + mp->out.seq, mbuf_Length(mo), l->name); mp->out.seq = inc_seq(mp->peer_is12bit, mp->out.seq); link_PushPacket(l, mo, bundle, PRI_NORMAL, PROTO_MP); @@ -710,10 +711,11 @@ mp_ShowStatus(struct cmdargs const *arg) first = mp_ReadHeader(mp, mp->inbufs, &mh) ? mh.seq : 0; last = mp_ReadHeader(mp, lm, &mh) ? mh.seq : 0; - prompt_Printf(arg->prompt, " (Have %lu - %lu, want %lu, lowest %lu)", + prompt_Printf(arg->prompt, " (Have %lu - %lu, want %lu, lowest %lu)\n", first, last, (unsigned long)mp->seq.next_in, (unsigned long)mp->seq.min_in); - prompt_Printf(arg->prompt, " first is %d, %d", mh.begin ? 1 : 0, mh.end ? 1 : 0); + prompt_Printf(arg->prompt, " First has %sbegin bit and " + "%send bit", mh.begin ? "" : "no ", mh.end ? "" : "no "); } prompt_Printf(arg->prompt, "\n"); } |