diff options
author | Randall Stewart <rrs@FreeBSD.org> | 2021-06-24 18:42:21 +0000 |
---|---|---|
committer | Michael Tuexen <tuexen@FreeBSD.org> | 2021-07-13 18:51:55 +0000 |
commit | 648c68168c24592967df9d9c6a4d79e1792e4562 (patch) | |
tree | 8d73952ca04b3bbe6457845a9da32b76e345d247 | |
parent | a3f96f1e5740e7b0648bab091083cb2c2e9d289b (diff) | |
download | src-648c68168c24592967df9d9c6a4d79e1792e4562.tar.gz src-648c68168c24592967df9d9c6a4d79e1792e4562.zip |
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)
-rw-r--r-- | sys/netinet/tcp_stacks/rack.c | 5 |
1 files changed, 4 insertions, 1 deletions
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: /* |