aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_syncache.c
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2024-09-05 01:33:13 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2024-09-05 01:33:13 +0000
commitef438f7706be48f1cf7fd4c8a60329e1619cfe30 (patch)
treef72cbf41c944feb5aefe53a518605c9a6b6bbab5 /sys/netinet/tcp_syncache.c
parent7aeec281b8b2620d7d88c9abdfadd7e20a485b9c (diff)
Diffstat (limited to 'sys/netinet/tcp_syncache.c')
-rw-r--r--sys/netinet/tcp_syncache.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 33a6a66b7138..d0a7690256f4 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -527,10 +527,16 @@ syncache_timer(void *xsch)
}
NET_EPOCH_ENTER(et);
- syncache_respond(sc, NULL, TH_SYN|TH_ACK);
+ if (syncache_respond(sc, NULL, TH_SYN|TH_ACK) == 0) {
+ syncache_timeout(sc, sch, 0);
+ TCPSTAT_INC(tcps_sndacks);
+ TCPSTAT_INC(tcps_sndtotal);
+ TCPSTAT_INC(tcps_sc_retransmitted);
+ } else {
+ syncache_drop(sc, sch);
+ TCPSTAT_INC(tcps_sc_dropped);
+ }
NET_EPOCH_EXIT(et);
- TCPSTAT_INC(tcps_sc_retransmitted);
- syncache_timeout(sc, sch, 0);
}
if (!TAILQ_EMPTY(&(sch)->sch_bucket))
callout_reset(&(sch)->sch_timer, (sch)->sch_nextc - tick,
@@ -688,7 +694,13 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th, struct mbuf *m,
"sending challenge ACK\n",
s, __func__,
th->th_seq, sc->sc_irs + 1, sc->sc_wnd);
- syncache_respond(sc, m, TH_ACK);
+ if (syncache_respond(sc, m, TH_ACK) == 0) {
+ TCPSTAT_INC(tcps_sndacks);
+ TCPSTAT_INC(tcps_sndtotal);
+ } else {
+ syncache_drop(sc, sch);
+ TCPSTAT_INC(tcps_sc_dropped);
+ }
}
} else {
if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
@@ -1549,6 +1561,9 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
syncache_timeout(sc, sch, 1);
TCPSTAT_INC(tcps_sndacks);
TCPSTAT_INC(tcps_sndtotal);
+ } else {
+ syncache_drop(sc, sch);
+ TCPSTAT_INC(tcps_sc_dropped);
}
SCH_UNLOCK(sch);
goto donenoprobe;