summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLawrence Stewart <lstewart@FreeBSD.org>2011-11-28 11:14:32 +0000
committerLawrence Stewart <lstewart@FreeBSD.org>2011-11-28 11:14:32 +0000
commitce4d7ccd9b090068d6a2cbb02f3014d13f67e3a0 (patch)
treeda297aef09dcf2a3a161c3a2206c6841bc493652
parent9fcfb7b6705c1f0cba27fd45a1d3e22e6de8bf5e (diff)
Notes
-rw-r--r--sys/netinet/tcp_reass.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index d1303615154d..f762dfd65734 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -233,23 +233,28 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m)
* when the zone is exhausted. Otherwise we may get stuck.
*/
te = uma_zalloc(V_tcp_reass_zone, M_NOWAIT);
- if (te == NULL && th->th_seq != tp->rcv_nxt) {
- TCPSTAT_INC(tcps_rcvmemdrop);
- m_freem(m);
- *tlenp = 0;
- if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) {
- log(LOG_DEBUG, "%s; %s: global zone limit reached, "
- "segment dropped\n", s, __func__);
- free(s, M_TCPLOG);
- }
- return (0);
- } else if (th->th_seq == tp->rcv_nxt) {
- bzero(&tqs, sizeof(struct tseg_qent));
- te = &tqs;
- if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) {
- log(LOG_DEBUG, "%s; %s: global zone limit reached, "
- "using stack for missing segment\n", s, __func__);
- free(s, M_TCPLOG);
+ if (te == NULL) {
+ if (th->th_seq != tp->rcv_nxt) {
+ TCPSTAT_INC(tcps_rcvmemdrop);
+ m_freem(m);
+ *tlenp = 0;
+ if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL,
+ NULL))) {
+ log(LOG_DEBUG, "%s; %s: global zone limit "
+ "reached, segment dropped\n", s, __func__);
+ free(s, M_TCPLOG);
+ }
+ return (0);
+ } else {
+ bzero(&tqs, sizeof(struct tseg_qent));
+ te = &tqs;
+ if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL,
+ NULL))) {
+ log(LOG_DEBUG,
+ "%s; %s: global zone limit reached, using "
+ "stack for missing segment\n", s, __func__);
+ free(s, M_TCPLOG);
+ }
}
}
tp->t_segqlen++;