diff options
-rw-r--r-- | sys/net/if.c | 8 | ||||
-rw-r--r-- | sys/netinet/ip_carp.c | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 34fd1aa84d7..c6131d0dc30 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.497 2017/05/16 12:24:01 mpi Exp $ */ +/* $OpenBSD: if.c,v 1.498 2017/05/28 12:47:24 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -977,8 +977,7 @@ if_deactivate(struct ifnet *ifp) { int s; - s = splnet(); - + NET_LOCK(s); /* * Call detach hooks from head to tail. To make sure detach * hooks are executed in the reverse order they were added, all @@ -991,8 +990,7 @@ if_deactivate(struct ifnet *ifp) if (ifp->if_carp && ifp->if_type != IFT_CARP) carp_ifdetach(ifp); #endif - - splx(s); + NET_UNLOCK(s); } /* diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 3b2ae3dff8d..44e2f9493a0 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.310 2017/05/27 21:55:52 bluhm Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.311 2017/05/28 12:47:24 mpi Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -870,8 +870,12 @@ int carp_clone_destroy(struct ifnet *ifp) { struct carp_softc *sc = ifp->if_softc; + int s; + NET_LOCK(s); carpdetach(sc); + NET_UNLOCK(s); + ether_ifdetach(ifp); if_detach(ifp); carp_destroy_vhosts(ifp->if_softc); |