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

Function carp_sc_state

freebsd/netinet/ip_carp.c:2070–2098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2068}
2069
2070static void
2071carp_sc_state(struct carp_softc *sc)
2072{
2073
2074 CARP_LOCK_ASSERT(sc);
2075
2076 if (sc->sc_carpdev->if_link_state != LINK_STATE_UP ||
2077 !(sc->sc_carpdev->if_flags & IFF_UP) ||
2078 !V_carp_allow) {
2079 callout_stop(&sc->sc_ad_tmo);
2080#ifdef INET
2081 callout_stop(&sc->sc_md_tmo);
2082#endif
2083#ifdef INET6
2084 callout_stop(&sc->sc_md6_tmo);
2085#endif
2086 carp_set_state(sc, INIT, "hardware interface down");
2087 carp_setrun(sc, 0);
2088 if (!sc->sc_suppress)
2089 carp_demote_adj(V_carp_ifdown_adj, "interface down");
2090 sc->sc_suppress = 1;
2091 } else {
2092 carp_set_state(sc, INIT, "hardware interface up");
2093 carp_setrun(sc, 0);
2094 if (sc->sc_suppress)
2095 carp_demote_adj(-V_carp_ifdown_adj, "interface up");
2096 sc->sc_suppress = 0;
2097 }
2098}
2099
2100static void
2101carp_demote_adj(int adj, char *reason)

Callers 4

carp_attachFunction · 0.85
carp_detachFunction · 0.85
carp_linkstateFunction · 0.85
carp_allow_sysctlFunction · 0.85

Calls 3

carp_set_stateFunction · 0.85
carp_setrunFunction · 0.85
carp_demote_adjFunction · 0.85

Tested by

no test coverage detected