diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/tcp_input.c | 13 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 13 |
2 files changed, 20 insertions, 6 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 3563fff..958a44f 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1057,8 +1057,12 @@ after_listen: /* * Add data to socket buffer. */ - m_adj(m, drop_hdrlen); /* delayed header drop */ - sbappend(&so->so_rcv, m); + if (so->so_state & SS_CANTRCVMORE) { + m_freem(m); + } else { + m_adj(m, drop_hdrlen); /* delayed header drop */ + sbappend(&so->so_rcv, m); + } sorwakeup(so); if (DELAY_ACK(tp)) { callout_reset(tp->tt_delack, tcp_delacktime, @@ -2086,7 +2090,10 @@ dodata: /* XXX */ tcpstat.tcps_rcvpack++; tcpstat.tcps_rcvbyte += tlen; ND6_HINT(tp); - sbappend(&so->so_rcv, m); + if (so->so_state & SS_CANTRCVMORE) + m_freem(m); + else + sbappend(&so->so_rcv, m); sorwakeup(so); } else { thflags = tcp_reass(tp, th, &tlen, m); diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 3563fff..958a44f 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -1057,8 +1057,12 @@ after_listen: /* * Add data to socket buffer. */ - m_adj(m, drop_hdrlen); /* delayed header drop */ - sbappend(&so->so_rcv, m); + if (so->so_state & SS_CANTRCVMORE) { + m_freem(m); + } else { + m_adj(m, drop_hdrlen); /* delayed header drop */ + sbappend(&so->so_rcv, m); + } sorwakeup(so); if (DELAY_ACK(tp)) { callout_reset(tp->tt_delack, tcp_delacktime, @@ -2086,7 +2090,10 @@ dodata: /* XXX */ tcpstat.tcps_rcvpack++; tcpstat.tcps_rcvbyte += tlen; ND6_HINT(tp); - sbappend(&so->so_rcv, m); + if (so->so_state & SS_CANTRCVMORE) + m_freem(m); + else + sbappend(&so->so_rcv, m); sorwakeup(so); } else { thflags = tcp_reass(tp, th, &tlen, m); |