Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_syncache.c
Show First 20 Lines • Show All 1,195 Lines • ▼ Show 20 Lines | syncache_tfo_expand(struct syncache *sc, struct socket **lsop, struct mbuf *m, | ||||
if (*lsop == NULL) { | if (*lsop == NULL) { | ||||
TCPSTAT_INC(tcps_sc_aborted); | TCPSTAT_INC(tcps_sc_aborted); | ||||
atomic_subtract_int(pending_counter, 1); | atomic_subtract_int(pending_counter, 1); | ||||
} else { | } else { | ||||
soisconnected(*lsop); | soisconnected(*lsop); | ||||
inp = sotoinpcb(*lsop); | inp = sotoinpcb(*lsop); | ||||
tp = intotcpcb(inp); | tp = intotcpcb(inp); | ||||
tp->t_flags |= TF_FASTOPEN; | tp->t_flags |= TF_FASTOPEN; | ||||
tp->t_tfo_cookie = response_cookie; | tp->t_tfo_cookie.server = response_cookie; | ||||
tp->snd_max = tp->iss; | tp->snd_max = tp->iss; | ||||
tp->snd_nxt = tp->iss; | tp->snd_nxt = tp->iss; | ||||
tp->t_tfo_pending = pending_counter; | tp->t_tfo_pending = pending_counter; | ||||
TCPSTAT_INC(tcps_sc_completed); | TCPSTAT_INC(tcps_sc_completed); | ||||
} | } | ||||
} | } | ||||
#endif /* TCP_RFC7413 */ | #endif /* TCP_RFC7413 */ | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | if ((inc->inc_flags & INC_ISIPV6) && | ||||
autoflowlabel = 1; | autoflowlabel = 1; | ||||
#endif | #endif | ||||
ip_ttl = inp->inp_ip_ttl; | ip_ttl = inp->inp_ip_ttl; | ||||
ip_tos = inp->inp_ip_tos; | ip_tos = inp->inp_ip_tos; | ||||
win = so->sol_sbrcv_hiwat; | win = so->sol_sbrcv_hiwat; | ||||
ltflags = (tp->t_flags & (TF_NOOPT | TF_SIGNATURE)); | ltflags = (tp->t_flags & (TF_NOOPT | TF_SIGNATURE)); | ||||
#ifdef TCP_RFC7413 | #ifdef TCP_RFC7413 | ||||
if (V_tcp_fastopen_enabled && IS_FASTOPEN(tp->t_flags) && | if (V_tcp_fastopen_server_enable && IS_FASTOPEN(tp->t_flags) && | ||||
(tp->t_tfo_pending != NULL) && (to->to_flags & TOF_FASTOPEN)) { | (tp->t_tfo_pending != NULL) && | ||||
(to->to_flags & TOF_FASTOPEN)) { | |||||
/* | /* | ||||
* Limit the number of pending TFO connections to | * Limit the number of pending TFO connections to | ||||
* approximately half of the queue limit. This prevents TFO | * approximately half of the queue limit. This prevents TFO | ||||
* SYN floods from starving the service by filling the | * SYN floods from starving the service by filling the | ||||
* listen queue with bogus TFO connections. | * listen queue with bogus TFO connections. | ||||
*/ | */ | ||||
if (atomic_fetchadd_int(tp->t_tfo_pending, 1) <= | if (atomic_fetchadd_int(tp->t_tfo_pending, 1) <= | ||||
(so->sol_qlimit / 2)) { | (so->sol_qlimit / 2)) { | ||||
▲ Show 20 Lines • Show All 964 Lines • Show Last 20 Lines |