summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/mp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-06-03 13:29:32 +0000
committerbrian <brian@FreeBSD.org>1999-06-03 13:29:32 +0000
commit3af49a50615a772322a03e657cd398337dea721e (patch)
tree98b5820ea182cb115947317f1be3c948d793720a /usr.sbin/ppp/mp.c
parent7467f798a2c24ba629a83631ec8be44056a0f0bd (diff)
downloadFreeBSD-src-3af49a50615a772322a03e657cd398337dea721e.zip
FreeBSD-src-3af49a50615a772322a03e657cd398337dea721e.tar.gz
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/ppp/mp.c')
-rw-r--r--usr.sbin/ppp/mp.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/ppp/mp.c b/usr.sbin/ppp/mp.c
index 2986e5d..901643e 100644
--- a/usr.sbin/ppp/mp.c
+++ b/usr.sbin/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.22 1999/06/02 15:59:06 brian Exp $
+ * $Id: mp.c,v 1.23 1999/06/02 23:06:21 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");
}
OpenPOWER on IntegriCloud