Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_syncache.c
Show First 20 Lines • Show All 508 Lines • ▼ Show 20 Lines | TAILQ_FOREACH_SAFE(sc, &sch->sch_bucket, sc_hash, nsc) { | ||||
* host does the SYN/ACK->ACK. | * host does the SYN/ACK->ACK. | ||||
*/ | */ | ||||
if (TSTMP_GT(sc->sc_rxttime, tick)) { | if (TSTMP_GT(sc->sc_rxttime, tick)) { | ||||
if (TSTMP_LT(sc->sc_rxttime, sch->sch_nextc)) | if (TSTMP_LT(sc->sc_rxttime, sch->sch_nextc)) | ||||
sch->sch_nextc = sc->sc_rxttime; | sch->sch_nextc = sc->sc_rxttime; | ||||
continue; | continue; | ||||
} | } | ||||
if (sc->sc_rxmits > V_tcp_ecn_maxretries) { | if (sc->sc_rxmits > V_tcp_ecn_maxretries) { | ||||
sc->sc_flags &= ~SCF_ECN; | sc->sc_flags &= ~SCF_ECN_MASK; | ||||
} | } | ||||
if (sc->sc_rxmits > V_tcp_syncache.rexmt_limit) { | if (sc->sc_rxmits > V_tcp_syncache.rexmt_limit) { | ||||
if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { | if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { | ||||
log(LOG_DEBUG, "%s; %s: Retransmits exhausted, " | log(LOG_DEBUG, "%s; %s: Retransmits exhausted, " | ||||
"giving up and removing syncache entry\n", | "giving up and removing syncache entry\n", | ||||
s, __func__); | s, __func__); | ||||
free(s, M_TCPLOG); | free(s, M_TCPLOG); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,033 Lines • ▼ Show 20 Lines | if (sc != NULL) { | ||||
/* | /* | ||||
* Update timestamp if present. | * Update timestamp if present. | ||||
*/ | */ | ||||
if ((sc->sc_flags & SCF_TIMESTAMP) && (to->to_flags & TOF_TS)) | if ((sc->sc_flags & SCF_TIMESTAMP) && (to->to_flags & TOF_TS)) | ||||
sc->sc_tsreflect = to->to_tsval; | sc->sc_tsreflect = to->to_tsval; | ||||
else | else | ||||
sc->sc_flags &= ~SCF_TIMESTAMP; | sc->sc_flags &= ~SCF_TIMESTAMP; | ||||
/* | /* | ||||
* Disable ECN if needed. | * Adjust ECN response if needed, e.g. different | ||||
* IP ECN field, or a fallback by the remote host. | |||||
*/ | */ | ||||
if ((sc->sc_flags & SCF_ECN) && | if (sc->sc_flags & SCF_ECN_MASK) { | ||||
((tcp_get_flags(th) & (TH_ECE|TH_CWR)) != (TH_ECE|TH_CWR))) { | sc->sc_flags &= ~SCF_ECN_MASK; | ||||
sc->sc_flags &= ~SCF_ECN; | sc->sc_flags = tcp_ecn_syncache_add(tcp_get_flags(th), iptos); | ||||
} | } | ||||
#ifdef MAC | #ifdef MAC | ||||
/* | /* | ||||
* Since we have already unconditionally allocated label | * Since we have already unconditionally allocated label | ||||
* storage, free it up. The syncache entry will already | * storage, free it up. The syncache entry will already | ||||
* have an initialized label we can use. | * have an initialized label we can use. | ||||
*/ | */ | ||||
mac_syncache_destroy(&maclabel); | mac_syncache_destroy(&maclabel); | ||||
▲ Show 20 Lines • Show All 1,002 Lines • Show Last 20 Lines |