Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2022 21:04:52 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 9453ec661961 - main - tcp: increment tcpstats in tcp_respond()
Message-ID:  <202209212104.28LL4qxW023838@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=9453ec661961d19919ec3927a5c90fc69bf23b4d

commit 9453ec661961d19919ec3927a5c90fc69bf23b4d
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2022-09-21 21:03:33 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2022-09-21 21:03:33 +0000

    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
---
 sys/netinet/tcp_subr.c | 6 ++++++
 1 file changed, 6 insertions(+)

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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202209212104.28LL4qxW023838>