Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_syncache.c
Show First 20 Lines • Show All 1,021 Lines • ▼ Show 20 Lines | |||||
#if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE) | #if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE) | ||||
if (sc->sc_flags & SCF_SIGNATURE) | if (sc->sc_flags & SCF_SIGNATURE) | ||||
tp->t_flags |= TF_SIGNATURE; | tp->t_flags |= TF_SIGNATURE; | ||||
#endif | #endif | ||||
if (sc->sc_flags & SCF_SACK) | if (sc->sc_flags & SCF_SACK) | ||||
tp->t_flags |= TF_SACK_PERMIT; | tp->t_flags |= TF_SACK_PERMIT; | ||||
} | } | ||||
if (sc->sc_flags & SCF_ECN) | if (sc->sc_flags & SCF_ECN) { | ||||
tp->t_flags2 |= TF2_ECN_PERMIT; | tp->t_flags2 |= TF2_ECN_PERMIT; | ||||
if (V_tcp_ecn_generalized) | |||||
tp->t_flags2 |= TF2_ECN_PLUSPLUS; | |||||
} | |||||
/* | /* | ||||
* Set up MSS and get cached values from tcp_hostcache. | * Set up MSS and get cached values from tcp_hostcache. | ||||
* This might overwrite some of the defaults we just set. | * This might overwrite some of the defaults we just set. | ||||
*/ | */ | ||||
tcp_mss(tp, sc->sc_peer_mss); | tcp_mss(tp, sc->sc_peer_mss); | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 898 Lines • ▼ Show 20 Lines | #endif /* INET */ | ||||
th->th_x2 = 0; | th->th_x2 = 0; | ||||
th->th_flags = flags; | th->th_flags = flags; | ||||
th->th_win = htons(sc->sc_wnd); | th->th_win = htons(sc->sc_wnd); | ||||
th->th_urp = 0; | th->th_urp = 0; | ||||
if ((flags & TH_SYN) && (sc->sc_flags & SCF_ECN)) { | if ((flags & TH_SYN) && (sc->sc_flags & SCF_ECN)) { | ||||
th->th_flags |= TH_ECE; | th->th_flags |= TH_ECE; | ||||
TCPSTAT_INC(tcps_ecn_shs); | TCPSTAT_INC(tcps_ecn_shs); | ||||
if ((V_tcp_ecn_generalized && | |||||
(flags & TH_ACK))) { | |||||
#ifdef INET6 | |||||
if (sc->sc_inc.inc_flags & INC_ISIPV6) | |||||
ip6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20); | |||||
#endif | |||||
#if defined(INET6) && defined(INET) | |||||
else | |||||
#endif | |||||
#ifdef INET | |||||
ip->ip_tos |= IPTOS_ECN_ECT0; | |||||
#endif | |||||
TCPSTAT_INC(tcps_ecn_ect0); | |||||
} | |||||
} | } | ||||
/* Tack on the TCP options. */ | /* Tack on the TCP options. */ | ||||
if ((sc->sc_flags & SCF_NOOPT) == 0) { | if ((sc->sc_flags & SCF_NOOPT) == 0) { | ||||
to.to_flags = 0; | to.to_flags = 0; | ||||
if (flags & TH_SYN) { | if (flags & TH_SYN) { | ||||
to.to_mss = mssopt; | to.to_mss = mssopt; | ||||
▲ Show 20 Lines • Show All 642 Lines • Show Last 20 Lines |