carp: Make sure that carp_ifaddr only happens in netisr0
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 3 Apr 2012 12:57:15 +0000 (20:57 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 3 Apr 2012 12:57:15 +0000 (20:57 +0800)
sys/netinet/ip_carp.c

index 764c1a8..464aaf2 100644 (file)
@@ -2448,6 +2448,9 @@ carp_ifaddr(void *arg __unused, struct ifnet *ifp,
        if (ifa->ifa_addr->sa_family != AF_INET)
                goto back;
 
+       KASSERT(&curthread->td_msgport == cpu_portfn(0),
+           ("not in netisr0"));
+
        if (ifp->if_type == IFT_CARP) {
                /*
                 * Address is changed on carp(4) interface