diff options
author | 2015-02-11 04:29:29 +0000 | |
---|---|---|
committer | 2015-02-11 04:29:29 +0000 | |
commit | 385d6f7527e21fec7b2e5d1203bbf545daf23641 (patch) | |
tree | 2d3ef8f63e47c23a7cbecb0155bd44ed8335d140 | |
parent | Eliminate sc_tx_cnt. Instead use an unsigned integer for sc_tx_prod and (diff) | |
download | wireguard-openbsd-385d6f7527e21fec7b2e5d1203bbf545daf23641.tar.xz wireguard-openbsd-385d6f7527e21fec7b2e5d1203bbf545daf23641.zip |
Until carp(4) is converted to call ether_ifattach() and ether_ifdetach(),
reroll the loop to free its Ethernet multicast addresses when destroying
an interface.
Prevent a panic found the hard way by phessler@
ok henning@, pelikan@, phessler@
-rw-r--r-- | sys/netinet/ip_carp.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index d22fa686d54..db09a8e1c5d 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.245 2015/01/21 11:20:48 mpi Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.246 2015/02/11 04:29:29 mpi Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -806,9 +806,19 @@ int carp_clone_destroy(struct ifnet *ifp) { struct carp_softc *sc = ifp->if_softc; + struct arpcom *ac = (struct arpcom *)ifp; + struct ether_multi *enm; carpdetach(sc); - ether_ifdetach(ifp); + + /* XXX should be converted to ether_ifattach() and ether_ifdetach() */ + for (enm = LIST_FIRST(&ac->ac_multiaddrs); + enm != NULL; + enm = LIST_FIRST(&ac->ac_multiaddrs)) { + LIST_REMOVE(enm, enm_list); + free(enm, M_IFMADDR, 0); + } + if_detach(ifp); carp_destroy_vhosts(ifp->if_softc); free(sc->sc_imo.imo_membership, M_IPMOPTS, 0); |