svn commit: r343525 - in head/sys/netinet: . tcp_stacks
Michael Tuexen
tuexen at FreeBSD.org
Mon Jan 28 12:45:32 UTC 2019
Author: tuexen
Date: Mon Jan 28 12:45:31 2019
New Revision: 343525
URL: https://svnweb.freebsd.org/changeset/base/343525
Log:
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@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18996
Modified:
head/sys/netinet/tcp_input.c
head/sys/netinet/tcp_stacks/rack.c
Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c Mon Jan 28 11:39:54 2019 (r343524)
+++ head/sys/netinet/tcp_input.c Mon Jan 28 12:45:31 2019 (r343525)
@@ -2010,7 +2010,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: head/sys/netinet/tcp_stacks/rack.c
==============================================================================
--- head/sys/netinet/tcp_stacks/rack.c Mon Jan 28 11:39:54 2019 (r343524)
+++ head/sys/netinet/tcp_stacks/rack.c Mon Jan 28 12:45:31 2019 (r343525)
@@ -5233,7 +5233,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);
}
More information about the svn-src-head
mailing list