diff options
author | glebius <glebius@FreeBSD.org> | 2005-02-24 09:05:28 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2005-02-24 09:05:28 +0000 |
commit | 64091a686c4803e6b3afbd4ab844ed833ce82092 (patch) | |
tree | e7cecbf1292c94ab3a45d42880c4bc0061fb63f1 /sys/netinet/ip_carp.c | |
parent | ba363997fb4f824d9160bc4cb388fe0bd0c6fcbc (diff) | |
download | FreeBSD-src-64091a686c4803e6b3afbd4ab844ed833ce82092.zip FreeBSD-src-64091a686c4803e6b3afbd4ab844ed833ce82092.tar.gz |
Fix problem when master comes up with one interface down, and preempts
mastering on all other interfaces:
- call carp_carpdev_state() on initialize instead of just setting to INIT
- in carp_carpdev_state() check that interface is UP, instead of checking
that it is not DOWN, because a rebooted machine may have interface in
UNKNOWN state.
Sponsored by: Rambler
Obtained from: OpenBSD (partially)
Diffstat (limited to 'sys/netinet/ip_carp.c')
-rw-r--r-- | sys/netinet/ip_carp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 8231f7f..2110a41 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1405,7 +1405,7 @@ carp_set_addr(struct carp_softc *sc, struct sockaddr_in *sin) sc->sc_if.if_flags |= IFF_UP; if (own) sc->sc_advskew = 0; - carp_set_state(sc, INIT); + carp_carpdev_state(cif); carp_setrun(sc, 0); return (0); @@ -1970,7 +1970,7 @@ carp_carpdev_state(void *v) CARP_LOCK(cif); TAILQ_FOREACH(sc, &cif->vhif_vrs, sc_list) { - if (sc->sc_ifp->if_link_state == LINK_STATE_DOWN || + if (sc->sc_ifp->if_link_state != LINK_STATE_UP || !(sc->sc_ifp->if_flags & IFF_UP)) { sc->sc_flags_backup = sc->sc_if.if_flags; sc->sc_if.if_flags &= ~(IFF_UP|IFF_RUNNING); |