aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2020-05-07 03:29:18 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2020-05-07 03:29:18 +0000
commitd88d35fcd453e66777e3cf23c7ad84be609471d8 (patch)
treeb297c5ee8a67f333c022db0ca16d46032c6dbc96
parent7e32ed7cdce242622a67ce923ae2635166b84965 (diff)
downloadsrc-d88d35fcd453e66777e3cf23c7ad84be609471d8.tar.gz
src-d88d35fcd453e66777e3cf23c7ad84be609471d8.zip
MFC r358621:
When using automatically generated flow labels and using TCP SYN cookies, use the same flow label for the segments sent during the handshake and after the handshake. This fixes a bug by making sure that sc_flowlabel is always stored in network byte order. Reviewed by: bz Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D23957
Notes
Notes: svn path=/stable/11/; revision=360768
-rw-r--r--sys/netinet/tcp_syncache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 4b6e6201ebc8..d0a74c8b66fd 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -2110,7 +2110,8 @@ syncookie_lookup(struct in_conninfo *inc, struct syncache_head *sch,
#ifdef INET6
case INC_ISIPV6:
if (sotoinpcb(lso)->inp_flags & IN6P_AUTOFLOWLABEL)
- sc->sc_flowlabel = sc->sc_iss & IPV6_FLOWLABEL_MASK;
+ sc->sc_flowlabel =
+ htonl(sc->sc_iss) & IPV6_FLOWLABEL_MASK;
break;
#endif
}