From owner-dev-commits-src-all@freebsd.org Thu Jun 24 18:44:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7988065292D; Thu, 24 Jun 2021 18:44:08 +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 4G9pvD33k9z3Hgy; Thu, 24 Jun 2021 18:44:08 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 52EAF1D020; Thu, 24 Jun 2021 18:44:08 +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 15OIi8ev066010; Thu, 24 Jun 2021 18:44:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15OIi8tx066009; Thu, 24 Jun 2021 18:44:08 GMT (envelope-from git) Date: Thu, 24 Jun 2021 18:44:08 GMT Message-Id: <202106241844.15OIi8tx066009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: 66aec14a5391 - main - tcp: Rack not being very friendly with V6:4 socket and having a connection from V4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66aec14a5391bda1e9a20f5e4381626797c3e0fb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 18:44:08 -0000 The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=66aec14a5391bda1e9a20f5e4381626797c3e0fb commit 66aec14a5391bda1e9a20f5e4381626797c3e0fb Author: Randall Stewart AuthorDate: 2021-06-24 18:42:21 +0000 Commit: Randall Stewart CommitDate: 2021-06-24 18:42:21 +0000 tcp: Rack not being very friendly with V6:4 socket and having a connection from V4 There were two bugs that prevented V4 sockets from connecting to a rack server running a V4/V6 socket. As well as a bug that stops the mapped v4 in V6 address from working. Reviewed by: mtuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30885 --- sys/netinet/tcp_stacks/rack.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index e37eedec460a..521fd6c625f5 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -12491,6 +12491,9 @@ rack_fini(struct tcpcb *tp, int32_t tcb_is_purged) static void rack_set_state(struct tcpcb *tp, struct tcp_rack *rack) { + if ((rack->r_state == TCPS_CLOSED) && (tp->t_state != TCPS_CLOSED)) { + rack->r_is_v6 = (tp->t_inpcb->inp_vflag & INP_IPV6) != 0; + } switch (tp->t_state) { case TCPS_SYN_SENT: rack->r_state = TCPS_SYN_SENT; @@ -16215,7 +16218,7 @@ rack_output(struct tcpcb *tp) } idle = 0; } - if (rack_use_fsb && (rack->r_fsb_inited == 0)) + if (rack_use_fsb && (rack->r_fsb_inited == 0) && (rack->r_state != TCPS_CLOSED)) rack_init_fsb_block(tp, rack); again: /*