Date: Sat, 4 May 2019 09:07:54 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347081 - in stable/12/sys/netinet: . tcp_stacks Message-ID: <201905040907.x4497seb065221@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Sat May 4 09:07:53 2019 New Revision: 347081 URL: https://svnweb.freebsd.org/changeset/base/347081 Log: MFC r343525: Fix the detection of ECN-setup SYN-ACK packets. RFC 3168 defines an ECN-setup SYN-ACK packet as on with the ECE flags set and the CWR flags not set. The code was only checking if ECE flag is set. This patch adds the check to verify that the CWR flags is not set. Submitted by: Richard Scheffenegger Reviewed by: tuexen@ Differential Revision: https://reviews.freebsd.org/D18996 Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Sat May 4 09:01:56 2019 (r347080) +++ stable/12/sys/netinet/tcp_input.c Sat May 4 09:07:53 2019 (r347081) @@ -2027,7 +2027,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru else tp->t_flags |= TF_ACKNOW; - if ((thflags & TH_ECE) && V_tcp_do_ecn) { + if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && + V_tcp_do_ecn) { tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 09:01:56 2019 (r347080) +++ stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 09:07:53 2019 (r347081) @@ -5245,7 +5245,8 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, st tp->t_flags |= TF_ACKNOW; } - if ((thflags & TH_ECE) && V_tcp_do_ecn) { + if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && + V_tcp_do_ecn) { tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905040907.x4497seb065221>