| 2032 | } |
| 2033 | |
| 2034 | static void |
| 2035 | carp_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 | |
| 2056 | static void |
| 2057 | carp_linkstate(struct ifnet *ifp) |
no test coverage detected