Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_syncache.c
Show First 20 Lines • Show All 1,811 Lines • ▼ Show 20 Lines | syncache_respond(struct syncache *sc, const struct mbuf *m0, int flags) | ||||
struct tcphdr *th = NULL; | struct tcphdr *th = NULL; | ||||
struct udphdr *udp = NULL; | struct udphdr *udp = NULL; | ||||
int optlen, error = 0; /* Make compiler happy */ | int optlen, error = 0; /* Make compiler happy */ | ||||
u_int16_t hlen, tlen, mssopt, ulen; | u_int16_t hlen, tlen, mssopt, ulen; | ||||
struct tcpopt to; | struct tcpopt to; | ||||
#ifdef INET6 | #ifdef INET6 | ||||
struct ip6_hdr *ip6 = NULL; | struct ip6_hdr *ip6 = NULL; | ||||
#endif | #endif | ||||
struct accecn ae; | |||||
NET_EPOCH_ASSERT(); | NET_EPOCH_ASSERT(); | ||||
hlen = | hlen = | ||||
#ifdef INET6 | #ifdef INET6 | ||||
(sc->sc_inc.inc_flags & INC_ISIPV6) ? sizeof(struct ip6_hdr) : | (sc->sc_inc.inc_flags & INC_ISIPV6) ? sizeof(struct ip6_hdr) : | ||||
#endif | #endif | ||||
sizeof(struct ip); | sizeof(struct ip); | ||||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
if (sc->sc_tfo_cookie) { | if (sc->sc_tfo_cookie) { | ||||
to.to_flags |= TOF_FASTOPEN; | to.to_flags |= TOF_FASTOPEN; | ||||
to.to_tfo_len = TCP_FASTOPEN_COOKIE_LEN; | to.to_tfo_len = TCP_FASTOPEN_COOKIE_LEN; | ||||
to.to_tfo_cookie = sc->sc_tfo_cookie; | to.to_tfo_cookie = sc->sc_tfo_cookie; | ||||
/* don't send cookie again when retransmitting response */ | /* don't send cookie again when retransmitting response */ | ||||
sc->sc_tfo_cookie = NULL; | sc->sc_tfo_cookie = NULL; | ||||
} | } | ||||
if (V_tcp_ecn_option) | |||||
to.to_flags |= TOF_ACCE_SYN; | |||||
} | |||||
if (V_tcp_ecn_option && | |||||
(sc->sc_flags & SCF_ECN_MASK) && | |||||
((sc->sc_flags & SCF_ECN_MASK) != SCF_ECN)) { | |||||
to.to_flags |= TOF_ACCECNOPT; | |||||
to.to_flags |= TOF_ACCE_E0 | | |||||
TOF_ACCE_E1 | | |||||
TOF_ACCE_CE; | |||||
ae.re0b = 1; | |||||
ae.re1b = 1; | |||||
ae.rceb = 0; | |||||
to.to_ae = &ae; | |||||
} | } | ||||
if (sc->sc_flags & SCF_TIMESTAMP) { | if (sc->sc_flags & SCF_TIMESTAMP) { | ||||
to.to_tsval = sc->sc_tsoff + tcp_ts_getticks(); | to.to_tsval = sc->sc_tsoff + tcp_ts_getticks(); | ||||
to.to_tsecr = sc->sc_tsreflect; | to.to_tsecr = sc->sc_tsreflect; | ||||
to.to_flags |= TOF_TS; | to.to_flags |= TOF_TS; | ||||
} | } | ||||
optlen = tcp_addoptions(&to, (u_char *)(th + 1)); | optlen = tcp_addoptions(&to, (u_char *)(th + 1)); | ||||
▲ Show 20 Lines • Show All 616 Lines • Show Last 20 Lines |