summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-05-28 12:47:25 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-05-28 12:47:25 +0000
commit04118fa5ed9bf6eb646ed527244f672e44201dfc (patch)
tree19a1c6c40df9a793b06861dff8feeaa3eef84688 /sys/netinet
parentee86ecd52acd7e87f7cdb0a368767ade52ac90a5 (diff)
Leaving IP multicast group requires the NET_LOCK().
Grab the lock before calling carpdetach(). ok bluhm@
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_carp.c6
1 files changed, 5 insertions, 1 deletions
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);