MCPcopy Create free account
hub / github.com/F-Stack/f-stack / syncache_unreach

Function syncache_unreach

freebsd/netinet/tcp_syncache.c:730–763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

728}
729
730void
731syncache_unreach(struct in_conninfo *inc, tcp_seq th_seq)
732{
733 struct syncache *sc;
734 struct syncache_head *sch;
735
736 if (syncache_cookiesonly())
737 return;
738 sc = syncache_lookup(inc, &sch); /* returns locked sch */
739 SCH_LOCK_ASSERT(sch);
740 if (sc == NULL)
741 goto done;
742
743 /* If the sequence number != sc_iss, then it's a bogus ICMP msg */
744 if (ntohl(th_seq) != sc->sc_iss)
745 goto done;
746
747 /*
748 * If we've rertransmitted 3 times and this is our second error,
749 * we remove the entry. Otherwise, we allow it to continue on.
750 * This prevents us from incorrectly nuking an entry during a
751 * spurious network outage.
752 *
753 * See tcp_notify().
754 */
755 if ((sc->sc_flags & SCF_UNREACH) == 0 || sc->sc_rxmits < 3 + 1) {
756 sc->sc_flags |= SCF_UNREACH;
757 goto done;
758 }
759 syncache_drop(sc, sch);
760 TCPSTAT_INC(tcps_sc_unreach);
761done:
762 SCH_UNLOCK(sch);
763}
764
765#ifdef LVS_TCPOPT_TOA
766

Callers 2

tcp_ctlinputFunction · 0.85
tcp6_ctlinputFunction · 0.85

Calls 3

syncache_cookiesonlyFunction · 0.85
syncache_lookupFunction · 0.85
syncache_dropFunction · 0.85

Tested by

no test coverage detected