diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1223,11 +1223,16 @@ !((tp->t_flags & TF_FORCEDATA) && len == 1 && SEQ_LT(tp->snd_una, tp->snd_max))) { #ifdef INET6 - if (isipv6) + if (isipv6) { + ip6->ip6_flow &= ~htonl(IPTOS_ECN_MASK << 20); ip6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20); + } else #endif + { + ip->ip_tos &= ~IPTOS_ECN_MASK; ip->ip_tos |= IPTOS_ECN_ECT0; + } TCPSTAT_INC(tcps_ecn_ect0); /* * Reply with proper ECN notifications. diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -16537,11 +16537,16 @@ */ if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max)) { #ifdef INET6 - if (rack->r_is_v6) + if (rack->r_is_v6) { + ip6->ip6_flow &= ~htonl(IPTOS_ECN_MASK << 20); ip6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20); + } else #endif + { + ip->ip_tos &= ~IPTOS_ECN_MASK; ip->ip_tos |= IPTOS_ECN_ECT0; + } KMOD_TCPSTAT_INC(tcps_ecn_ect0); /* * Reply with proper ECN notifications. @@ -18614,11 +18619,16 @@ if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && (sack_rxmit == 0)) { #ifdef INET6 - if (isipv6) + if (isipv6) { + ip6->ip6_flow &= ~htonl(IPTOS_ECN_MASK << 20); ip6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20); + } else #endif + { + ip->ip_tos &= IPTOS_ECN_MASK; ip->ip_tos |= IPTOS_ECN_ECT0; + } KMOD_TCPSTAT_INC(tcps_ecn_ect0); /* * Reply with proper ECN notifications.