diff --git a/sys/netinet/ip_carp.h b/sys/netinet/ip_carp.h --- a/sys/netinet/ip_carp.h +++ b/sys/netinet/ip_carp.h @@ -127,7 +127,7 @@ int carpr_vhid; #define CARP_MAXVHID 255 int carpr_state; -#define CARP_STATES "INIT", "BACKUP", "MASTER" +#define CARP_STATES "INIT", "BACKUP", "MASTER", "SUPPRESS" #define CARP_MAXSTATE 2 int carpr_advskew; #define CARP_MAXSKEW 240 diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -118,7 +118,7 @@ int sc_naddrs; int sc_naddrs6; int sc_ifasiz; - enum { INIT = 0, BACKUP, MASTER } sc_state; + enum { INIT = 0, BACKUP, MASTER, SUPPRESS } sc_state; int sc_suppress; int sc_sendad_errors; #define CARP_SENDAD_MAX_ERRORS 3 @@ -762,6 +762,7 @@ ch_tv.tv_usec = ch->carp_advskew * 1000000 / 256; switch (sc->sc_state) { + case SUPPRESS: case INIT: break; case MASTER: @@ -1341,6 +1342,7 @@ carp_setrun(sc, 0); carp_addroute(sc); break; + case SUPPRESS: case INIT: case MASTER: #ifdef INVARIANTS @@ -1371,6 +1373,7 @@ return; switch (sc->sc_state) { + case SUPPRESS: case INIT: carp_set_state(sc, BACKUP, "initialization complete"); carp_setrun(sc, 0); @@ -1838,7 +1841,7 @@ bcopy(carpr->carpr_key, sc->sc_key, sizeof(sc->sc_key)); carp_hmac_prepare(sc); } - if (sc->sc_state != INIT && + if (sc->sc_state != INIT && sc->sc_state != SUPPRESS && carpr->carpr_state != sc->sc_state) { switch (carpr->carpr_state) { case BACKUP: @@ -2157,7 +2160,7 @@ #ifdef INET6 callout_stop(&sc->sc_md6_tmo); #endif - carp_set_state(sc, INIT, "hardware interface down"); + carp_set_state(sc, SUPPRESS, "hardware interface down"); carp_setrun(sc, 0); if (!sc->sc_suppress) carp_demote_adj(V_carp_ifdown_adj, "interface down");