aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_syncache.c
diff options
context:
space:
mode:
authorRandall Stewart <rrs@FreeBSD.org>2020-02-12 13:04:19 +0000
committerRandall Stewart <rrs@FreeBSD.org>2020-02-12 13:04:19 +0000
commit596ae436ef8fdf767b29cb67a12745b02f61a994 (patch)
tree80d4a69aeb22b1c378f97aca2e50510e11a669b9 /sys/netinet/tcp_syncache.c
parent3fba40d9f2b3551ec627891640dd63829dc13fba (diff)
downloadsrc-596ae436ef8fdf767b29cb67a12745b02f61a994.tar.gz
src-596ae436ef8fdf767b29cb67a12745b02f61a994.zip
This small fix makes it so we properly follow
the RFC and only enable ECN when both the CWR and ECT bits our set within the SYN packet. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D23645
Notes
Notes: svn path=/head/; revision=357816
Diffstat (limited to 'sys/netinet/tcp_syncache.c')
-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 98c90c561d13..e5f7dde531ca 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -1668,7 +1668,8 @@ skip_alloc:
sc->sc_peer_mss = to->to_mss; /* peer mss may be zero */
if (ltflags & TF_NOOPT)
sc->sc_flags |= SCF_NOOPT;
- if ((th->th_flags & (TH_ECE|TH_CWR)) && V_tcp_do_ecn)
+ if (((th->th_flags & (TH_ECE|TH_CWR)) == (TH_ECE|TH_CWR)) &&
+ V_tcp_do_ecn)
sc->sc_flags |= SCF_ECN;
if (V_tcp_syncookies)