Hi,
when we detach the interface from the carp the hook that is called
when an address is updated is disestablished. But it never again
gets re-established, which makes the carp interface unusable. This
happens for instance if you run carp on trunk and destroy the trunk
interface.
This diff seems to fix it for me, but I'm not sure what kind of re-
purcussions there are if we keep the hook without an interface.
What do you think?
Patrick
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 649c7501798..074307ae79c 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -878,6 +878,8 @@ carp_clone_destroy(struct ifnet *ifp)
NET_LOCK();
carpdetach(sc);
+ if (sc->ah_cookie != NULL)
+ hook_disestablish(sc->sc_if.if_addrhooks, sc->ah_cookie);
NET_UNLOCK();
ether_ifdetach(ifp);
@@ -920,9 +922,6 @@ carpdetach(struct carp_softc *sc)
carp_setrun_all(sc, 0);
carp_multicast_cleanup(sc);
- if (sc->ah_cookie != NULL)
- hook_disestablish(sc->sc_if.if_addrhooks, sc->ah_cookie);
-
ifp0 = sc->sc_carpdev;
if (ifp0 == NULL)
return;