| 2068 | } |
| 2069 | |
| 2070 | static void |
| 2071 | carp_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 | |
| 2100 | static void |
| 2101 | carp_demote_adj(int adj, char *reason) |
no test coverage detected