diff options
author | brian <brian@cvs.openbsd.org> | 2000-07-12 15:07:46 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 2000-07-12 15:07:46 +0000 |
commit | 8c68c8e1ecacc6b9e1a83809f46e17c9db0754fd (patch) | |
tree | 0496aec7d75210de49b329b38bb6b5560b1f01a6 | |
parent | 4290497538483eceb907eb7bf6987eda7ee85b37 (diff) |
Fix a rather nasty latency problem that occurs with single tcp sessions
thorough an MP setup with only a single link.
-rw-r--r-- | usr.sbin/ppp/ppp/mp.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/usr.sbin/ppp/ppp/mp.c b/usr.sbin/ppp/ppp/mp.c index 292fe7f68b2..c4fdcdac457 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. * - * $OpenBSD: mp.c,v 1.16 2000/06/13 09:57:51 brian Exp $ + * $OpenBSD: mp.c,v 1.17 2000/07/12 15:07:45 brian Exp $ */ #include <sys/param.h> @@ -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) { |