From nobody Wed Sep 21 21:04:52 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MXrX46H9Gz4cK1h; Wed, 21 Sep 2022 21:04:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MXrX45kppz3nY0; Wed, 21 Sep 2022 21:04:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663794292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p11UcsE5SK2KmGu56QcrBemTCb6rK49mEssTpsbOEMA=; b=VcBA6YgoLcHcIcgABzTqGETKZBJH1HqEU9hsnjT5KaxswHK2ImkDXf00307mrok2ycIP1b 5/z9Ftd7Hlwn97wHPkMC94HMbyOjkPXN78OYLBNzIev6ihTtKAq6HW69Jz6tAErmEkFhsN AQrNHoY4VXANJWNk5BZmIbKICiEMBbECa38iMGlujZr+AHAYt9uPBae3rF07XNeyGwKmp1 WoL4vC22iuzA9XWgmTlOAC0LLRdLvUFRzLQQJL4gnIODga0deFhzlkWvrOuA3JUYLH7D8S 1jsN1e8kYayx3laqM6AG0kT1ZdkxSj+UcEksMc9d+dZUyydF8imYKD9Khl5Pmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MXrX44qtTz1B5w; Wed, 21 Sep 2022 21:04:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28LL4qLO023839; Wed, 21 Sep 2022 21:04:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28LL4qxW023838; Wed, 21 Sep 2022 21:04:52 GMT (envelope-from git) Date: Wed, 21 Sep 2022 21:04:52 GMT Message-Id: <202209212104.28LL4qxW023838@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 9453ec661961 - main - tcp: increment tcpstats in tcp_respond() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9453ec661961d19919ec3927a5c90fc69bf23b4d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663794292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p11UcsE5SK2KmGu56QcrBemTCb6rK49mEssTpsbOEMA=; b=GqSaScjc9ZCqvBmQCul57SxcyCALxyHaVrRiOSBFrlrQLkb+7GI1wZ+pWQ/E4lUieyxU4+ 0UAypThImid920kyeW0bN25oibcyEXxA2uD0vxa65jhoCYA26Oj9wztlMzwhl7Lzw5jFTS 9yT4k9Wv3xlw4v2U6MfQUUUYpvg0EkNs/IR/io3DZtxZ2h4dISaGUdlJfYwIdaC592XuFa Zsdzb4MBtQm3G4jQXvhX0+FxSOAsNE1b6+C0vQwydcry9mTrOd2JUmV5Hol77RWQrrSXbX 897JvFMAFgPeP0kigzxqKJHLM9ATHMKOSfeVeDANFqOvh/yL+10HBj3+UJtxkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663794292; a=rsa-sha256; cv=none; b=ieCMk40LTHp+LAdVqxWbyhCBEVSEmzre7xryRh2xFb63tdhlaJMxx90xV0TPE8/EI09j6X VqJqO5mQs04T/0jHDwctZIxHsgvRAe2LIdaZYILeocClgVnfBOfqqY9qFr4r5HvjXd4RXK kzSyLDRUbGnpeUPihGV+wUxclEkpigdL2Csma+kpDG7mKeS52m7XVfAf/g9zS4EwXxva2t Oufx7LA+q5uZ97bZssmBIX+22K71mWnyzCn5rmCUzs1GQYKCvEdVcTF9rVsXH5m/GLZYlj eAajcT/0IHfMQ6jQKDH30oh9QkrvotNzunazSVNihfDRMctEDOBlpLfAseQwaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9453ec661961d19919ec3927a5c90fc69bf23b4d commit 9453ec661961d19919ec3927a5c90fc69bf23b4d Author: Gleb Smirnoff AuthorDate: 2022-09-21 21:03:33 +0000 Commit: Gleb Smirnoff 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);