From cb8bd8dd72b0fd8c7cbdf6ca8d94148f1ae9ee18 Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Wed, 12 Jul 2000 15:08:03 +0000 Subject: [PATCH] Fix a rather nasty latency problem that occurs with single tcp sessions thorough an MP setup with only a single link. --- usr.sbin/ppp/mp.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/usr.sbin/ppp/mp.c b/usr.sbin/ppp/mp.c index 579e1d28b248..109b66af6ab9 100644 --- a/usr.sbin/ppp/mp.c +++ b/usr.sbin/ppp/mp.c @@ -442,26 +442,32 @@ mp_Assemble(struct mp *mp, struct mbuf *m, struct physical *p) * the queue. */ - if (!mp->inbufs) { - mp->inbufs = m; - m = NULL; - } - last = NULL; seq = mp->seq.next_in; q = mp->inbufs; - while (q) { - mp_ReadHeader(mp, q, &h); - if (m && isbefore(mp->local_is12bit, mh.seq, h.seq)) { - /* Our received fragment fits in before this one, so link it in */ + while (q || m) { + if (!q) { if (last) last->m_nextpkt = m; else mp->inbufs = m; - m->m_nextpkt = q; q = m; - h = mh; m = NULL; + h = mh; + } else { + mp_ReadHeader(mp, q, &h); + + if (m && isbefore(mp->local_is12bit, mh.seq, h.seq)) { + /* Our received fragment fits in before this one, so link it in */ + if (last) + last->m_nextpkt = m; + else + mp->inbufs = m; + m->m_nextpkt = q; + q = m; + h = mh; + m = NULL; + } } if (h.seq != seq) {