diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-09-21 21:03:33 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-09-21 21:03:33 +0000 |
commit | 9453ec661961d19919ec3927a5c90fc69bf23b4d (patch) | |
tree | 710c9356821cb7991d89ae1b4b15b809a984f0db | |
parent | 493105c2a8f95be99b5299af650fcf8b59b91f55 (diff) | |
download | src-9453ec661961d19919ec3927a5c90fc69bf23b4d.tar.gz src-9453ec661961d19919ec3927a5c90fc69bf23b4d.zip |
tcp: increment tcpstats in tcp_respond()
tcp_respond() crafts a packet and sends it directly to ip[6]output(),
bypassing tcp_output(). Hence it must increment TCP send statistics.
Reviewed by: rscheff, tuexen, rrs (implicitly)
Differential revision: https://reviews.freebsd.org/D36641
-rw-r--r-- | sys/netinet/tcp_subr.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index f2dc1b0b2836..f9dc57e1df66 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2174,6 +2174,12 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, } } + if (flags & TH_ACK) + TCPSTAT_INC(tcps_sndacks); + else if (flags & (TH_SYN|TH_FIN|TH_RST)) + TCPSTAT_INC(tcps_sndctrl); + TCPSTAT_INC(tcps_sndtotal); + #ifdef INET6 if (isipv6) { TCP_PROBE5(send, NULL, tp, ip6, tp, nth); |