Date: Tue, 17 Jun 2025 15:50: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: 3ed8d5645dd4 - main - tcp: increase tcps_sc_recvcookie only in the syncache_expand() Message-ID: <202506171550.55HFoica029516@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=3ed8d5645dd42a7c080ba800cf6d25cb7e147d7e commit 3ed8d5645dd42a7c080ba800cf6d25cb7e147d7e Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2025-06-17 15:50:17 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2025-06-17 15:50:17 +0000 tcp: increase tcps_sc_recvcookie only in the syncache_expand() The syncookie_expand() is called from syncookie_cmp() in INVARIANTS mode to confirm that values calculated via syncookies mechanism match those stored in the syncache entry. This creates a counting bug, that with INVARIANTS every successful use of syncache also counts as use of a syncookie. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D50897 --- sys/netinet/tcp_syncache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 2832825f0c40..f7dfed78b0eb 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1113,8 +1113,10 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, goto failed; } bzero(&scs, sizeof(scs)); - if (syncookie_expand(inc, sch, &scs, th, to, *lsop, port)) + if (syncookie_expand(inc, sch, &scs, th, to, *lsop, port)) { sc = &scs; + TCPSTAT_INC(tcps_sc_recvcookie); + } if (locked) SCH_UNLOCK(sch); if (sc == NULL) { @@ -2344,7 +2346,6 @@ syncookie_expand(struct in_conninfo *inc, const struct syncache_head *sch, sc->sc_port = port; - TCPSTAT_INC(tcps_sc_recvcookie); return (true); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202506171550.55HFoica029516>