diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2004-02-27 16:44:46 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2004-02-27 16:44:46 +0000 |
commit | ce71cbcd8227e0f85e6d4b885e70257aba2be4e3 (patch) | |
tree | 90b796e79559c384aa0e59efe2b2bd96bf271312 /sys/netinet/tcp_input.c | |
parent | 04ba08ddaafabd27c10d9f1c3a1abc3998c604b2 (diff) |
implement tcp_drain() similar to ip_drain(); ok mcbride@
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index f97c74cf018..2da98f80342 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.155 2004/02/11 20:12:33 markus Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.156 2004/02/27 16:44:44 markus Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -1221,8 +1221,10 @@ after_listen: tp->snd_scale = tp->requested_s_scale; tp->rcv_scale = tp->request_r_scale; } + tcp_reass_lock(tp); (void) tcp_reass(tp, (struct tcphdr *)0, (struct mbuf *)0, &tlen); + tcp_reass_unlock(tp); /* * if we didn't have to retransmit the SYN, * use its rtt as our initial srtt & rtt var. @@ -1475,8 +1477,10 @@ trimthenstep6: tp->snd_scale = tp->requested_s_scale; tp->rcv_scale = tp->request_r_scale; } + tcp_reass_lock(tp); (void) tcp_reass(tp, (struct tcphdr *)0, (struct mbuf *)0, &tlen); + tcp_reass_unlock(tp); tp->snd_wl1 = th->th_seq - 1; /* fall into ... */ @@ -1979,8 +1983,10 @@ dodata: /* XXX */ */ if ((tlen || (tiflags & TH_FIN)) && TCPS_HAVERCVDFIN(tp->t_state) == 0) { + tcp_reass_lock(tp); if (th->th_seq == tp->rcv_nxt && tp->segq.lh_first == NULL && tp->t_state == TCPS_ESTABLISHED) { + tcp_reass_unlock(tp); TCP_SETUP_ACK(tp, tiflags); tp->rcv_nxt += tlen; tiflags = th->th_flags & TH_FIN; @@ -1997,6 +2003,7 @@ dodata: /* XXX */ } else { m_adj(m, hdroptlen); tiflags = tcp_reass(tp, th, m, &tlen); + tcp_reass_unlock(tp); tp->t_flags |= TF_ACKNOW; } #ifdef TCP_SACK |