1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-02 12:20:51 +00:00

Fix carp(4) panics that can occur during carp interface configuration.

Approved by:	mlaier (mentor)
Reported by:	Scott Ullrich
MFC after:	1 week
This commit is contained in:
Ermal Luçi 2008-07-14 20:11:51 +00:00
parent 189af44216
commit 7972c979c5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=180513

View File

@ -1464,7 +1464,11 @@ carp_set_addr(struct carp_softc *sc, struct sockaddr_in *sin)
carp_set_state(sc, INIT);
if (sc->sc_naddrs)
SC2IFP(sc)->if_flags |= IFF_UP;
if (sc->sc_carpdev)
CARP_SCLOCK(sc);
carp_setrun(sc, 0);
if (sc->sc_carpdev)
CARP_SCUNLOCK(sc);
return (0);
}
@ -1625,7 +1629,11 @@ carp_set_addr6(struct carp_softc *sc, struct sockaddr_in6 *sin6)
carp_set_state(sc, INIT);
if (sc->sc_naddrs6)
SC2IFP(sc)->if_flags |= IFF_UP;
if (sc->sc_carpdev)
CARP_SCLOCK(sc);
carp_setrun(sc, 0);
if (sc->sc_carpdev)
CARP_SCUNLOCK(sc);
return (0);
}