Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 2021 18:53:13 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 648c68168c24 - stable/13 - tcp: Rack not being very friendly with V6:4 socket and having a connection from V4
Message-ID:  <202107131853.16DIrDS1091168@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=648c68168c24592967df9d9c6a4d79e1792e4562

commit 648c68168c24592967df9d9c6a4d79e1792e4562
Author:     Randall Stewart <rrs@FreeBSD.org>
AuthorDate: 2021-06-24 18:42:21 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2021-07-13 18:51:55 +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:            tuexen
    Sponsored by:           Netflix Inc
    Differential Revision:  https://reviews.freebsd.org/D30885
    PR:                     256657
    (cherry picked from commit 66aec14a5391bda1e9a20f5e4381626797c3e0fb)
---
 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 dc3c8d47dc31..79eec2a7d063 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:
 	/*



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