Changeset View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 1,643 Lines • ▼ Show 20 Lines | if (tp->t_state == TCPS_SYN_SENT && (thflags & TH_SYN)) { | ||||
if (!(thflags & TH_ACK) && | if (!(thflags & TH_ACK) && | ||||
((thflags & (TH_CWR | TH_ECE)) == (TH_CWR | TH_ECE)) && | ((thflags & (TH_CWR | TH_ECE)) == (TH_CWR | TH_ECE)) && | ||||
((V_tcp_do_ecn == 1) || (V_tcp_do_ecn == 2))) { | ((V_tcp_do_ecn == 1) || (V_tcp_do_ecn == 2))) { | ||||
tp->t_flags2 |= TF2_ECN_PERMIT; | tp->t_flags2 |= TF2_ECN_PERMIT; | ||||
tp->t_flags2 |= TF2_ECN_SND_ECE; | tp->t_flags2 |= TF2_ECN_SND_ECE; | ||||
TCPSTAT_INC(tcps_ecn_shs); | TCPSTAT_INC(tcps_ecn_shs); | ||||
} | } | ||||
if ((to.to_flags & TOF_SCALE) && | if ((to.to_flags & TOF_SCALE) && | ||||
(tp->t_flags & TF_REQ_SCALE)) { | (tp->t_flags & TF_REQ_SCALE) && | ||||
!(tp->t_flags & TF_NOOPT)) { | |||||
tuexen: We need to replace
```
if ((to.to_flags & TOF_SCALE) &&
(tp->t_flags & TF_REQ_SCALE)) {
```… | |||||
tp->t_flags |= TF_RCVD_SCALE; | tp->t_flags |= TF_RCVD_SCALE; | ||||
tp->snd_scale = to.to_wscale; | tp->snd_scale = to.to_wscale; | ||||
} else | } else | ||||
tp->t_flags &= ~TF_REQ_SCALE; | tp->t_flags &= ~TF_REQ_SCALE; | ||||
/* | /* | ||||
* Initial send window. It will be updated with | * Initial send window. It will be updated with | ||||
* the next incoming segment to the scaled value. | * the next incoming segment to the scaled value. | ||||
*/ | */ | ||||
tp->snd_wnd = th->th_win; | tp->snd_wnd = th->th_win; | ||||
if ((to.to_flags & TOF_TS) && | if ((to.to_flags & TOF_TS) && | ||||
(tp->t_flags & TF_REQ_TSTMP)) { | (tp->t_flags & TF_REQ_TSTMP) && | ||||
!(tp->t_flags & TF_NOOPT)) { | |||||
tp->t_flags |= TF_RCVD_TSTMP; | tp->t_flags |= TF_RCVD_TSTMP; | ||||
tp->ts_recent = to.to_tsval; | tp->ts_recent = to.to_tsval; | ||||
tp->ts_recent_age = tcp_ts_getticks(); | tp->ts_recent_age = tcp_ts_getticks(); | ||||
} else | } else | ||||
tp->t_flags &= ~TF_REQ_TSTMP; | tp->t_flags &= ~TF_REQ_TSTMP; | ||||
if (to.to_flags & TOF_MSS) | if (to.to_flags & TOF_MSS) | ||||
tcp_mss(tp, to.to_mss); | tcp_mss(tp, to.to_mss); | ||||
if ((tp->t_flags & TF_SACK_PERMIT) && | if ((tp->t_flags & TF_SACK_PERMIT) && | ||||
(to.to_flags & TOF_SACKPERM) == 0) | (!(to.to_flags & TOF_SACKPERM) || | ||||
(tp->t_flags & TF_NOOPT))) | |||||
tp->t_flags &= ~TF_SACK_PERMIT; | tp->t_flags &= ~TF_SACK_PERMIT; | ||||
if (IS_FASTOPEN(tp->t_flags)) { | if (IS_FASTOPEN(tp->t_flags) && | ||||
!(tp->t_flags & TF_NOOPT)) { | |||||
Done Inline ActionsI don't think we should never be here with TCP_NOOPT. tuexen: I don't think we should never be here with TCP_NOOPT.
Also disabling the path is not the… | |||||
Done Inline ActionsThis also deals with the parallel open state: While we may not have sent TFO in the outgoing SYN, the incoming SYN could have a TFO option. I suggest to gracefully disable TFO in this case, instead of having one half-connecting in TFO state, and the other without TFO, as NOOPT prevents the transmission of TFO later in tcp_output(). rscheff: This also deals with the parallel open state: While we may not have sent TFO in the outgoing… | |||||
Not Done Inline ActionsIf you want to do a check here, do it above. The way you do it now results in disabling TFO with a reason for doing so. tuexen: If you want to do a check here, do it above. The way you do it now results in disabling TFO… | |||||
Not Done Inline Actions
tuexen: > This also deals with the parallel open state: While we may not have sent TFO in the outgoing… | |||||
if (to.to_flags & TOF_FASTOPEN) { | if (to.to_flags & TOF_FASTOPEN) { | ||||
uint16_t mss; | uint16_t mss; | ||||
if (to.to_flags & TOF_MSS) | if (to.to_flags & TOF_MSS) | ||||
mss = to.to_mss; | mss = to.to_mss; | ||||
else | else | ||||
if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0) | if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0) | ||||
mss = TCP6_MSS; | mss = TCP6_MSS; | ||||
▲ Show 20 Lines • Show All 2,371 Lines • Show Last 20 Lines |
We need to replace
by