Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_ecn.c
Show First 20 Lines • Show All 405 Lines • ▼ Show 20 Lines | tcp_ecn_output_established(struct tcpcb *tp, uint16_t *thflags, int len, bool rxmit) | ||||
* Ignore pure control packets, retransmissions | * Ignore pure control packets, retransmissions | ||||
* and window probes. | * and window probes. | ||||
*/ | */ | ||||
newdata = (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && | newdata = (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && | ||||
!rxmit && | !rxmit && | ||||
!((tp->t_flags & TF_FORCEDATA) && len == 1)); | !((tp->t_flags & TF_FORCEDATA) && len == 1)); | ||||
/* RFC3168 ECN marking, only new data segments */ | /* RFC3168 ECN marking, only new data segments */ | ||||
if (newdata) { | if (newdata) { | ||||
if (tp->t_flags2 & TF2_ECN_USE_ECT1) { | |||||
ipecn = IPTOS_ECN_ECT1; | |||||
TCPSTAT_INC(tcps_ecn_ect1); | |||||
} else { | |||||
ipecn = IPTOS_ECN_ECT0; | ipecn = IPTOS_ECN_ECT0; | ||||
TCPSTAT_INC(tcps_ecn_ect0); | TCPSTAT_INC(tcps_ecn_ect0); | ||||
} | |||||
} | } | ||||
/* | /* | ||||
* Reply with proper ECN notifications. | * Reply with proper ECN notifications. | ||||
*/ | */ | ||||
if (tp->t_flags2 & TF2_ACE_PERMIT) { | if (tp->t_flags2 & TF2_ACE_PERMIT) { | ||||
*thflags &= ~(TH_AE|TH_CWR|TH_ECE); | *thflags &= ~(TH_AE|TH_CWR|TH_ECE); | ||||
if (tp->t_rcep & 0x01) | if (tp->t_rcep & 0x01) | ||||
*thflags |= TH_ECE; | *thflags |= TH_ECE; | ||||
▲ Show 20 Lines • Show All 179 Lines • Show Last 20 Lines |