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

Function carp_set_state

freebsd/netinet/ip_carp.c:2034–2054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2032}
2033
2034static void
2035carp_set_state(struct carp_softc *sc, int state, const char *reason)
2036{
2037
2038 CARP_LOCK_ASSERT(sc);
2039
2040 if (sc->sc_state != state) {
2041 const char *carp_states[] = { CARP_STATES };
2042 char subsys[IFNAMSIZ+5];
2043
2044 snprintf(subsys, IFNAMSIZ+5, "%u@%s", sc->sc_vhid,
2045 sc->sc_carpdev->if_xname);
2046
2047 CARP_LOG("%s: %s -> %s (%s)\n", subsys,
2048 carp_states[sc->sc_state], carp_states[state], reason);
2049
2050 sc->sc_state = state;
2051
2052 devctl_notify("CARP", subsys, carp_states[state], NULL);
2053 }
2054}
2055
2056static void
2057carp_linkstate(struct ifnet *ifp)

Callers 5

carp_input_cFunction · 0.85
carp_master_down_lockedFunction · 0.85
carp_setrunFunction · 0.85
carp_ioctlFunction · 0.85
carp_sc_stateFunction · 0.85

Calls 2

snprintfFunction · 0.85
devctl_notifyFunction · 0.50

Tested by

no test coverage detected