Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Dec 2021 20:32:44 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: 13e3f3349f42 - main - in_pcb: fix TCP local ephemeral port accounting
Message-ID:  <202112032032.1B3KWif8038001@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=13e3f3349f42d30bd320b8b5cabecb4d66360c92

commit 13e3f3349f42d30bd320b8b5cabecb4d66360c92
Author:     Peter Lei <peterlei@netflix.com>
AuthorDate: 2021-12-03 20:30:21 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2021-12-03 20:30:21 +0000

    in_pcb: fix TCP local ephemeral port accounting
    
    Fix logic error causing UDP(-Lite) local ephemeral port bindings
    to count against the TCP allocation counter, potentially causing
    TCP to go from random to sequential port allocation mode prematurely.
---
 sys/netinet/in_pcb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 081d204f559c..a894163ed5a6 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -748,7 +748,7 @@ in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, u_short *lportp,
 	if (first == last)
 		dorandom = 0;
 	/* Make sure to not include UDP(-Lite) packets in the count. */
-	if (pcbinfo != &V_udbinfo || pcbinfo != &V_ulitecbinfo)
+	if (pcbinfo != &V_udbinfo && pcbinfo != &V_ulitecbinfo)
 		V_ipport_tcpallocs++;
 	/*
 	 * Instead of having two loops further down counting up or down



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