diff options
author | 2005-05-27 08:33:25 +0000 | |
---|---|---|
committer | 2005-05-27 08:33:25 +0000 | |
commit | ee150f959be8ebc0669b32f9389a89ce25e8e82c (patch) | |
tree | 15c47be52490d533d6b6f916124eb39eaa31b5ca | |
parent | fix -O for cases where no ControlPath has been specified or socket at (diff) | |
download | wireguard-openbsd-ee150f959be8ebc0669b32f9389a89ce25e8e82c.tar.xz wireguard-openbsd-ee150f959be8ebc0669b32f9389a89ce25e8e82c.zip |
only access if_linkstatehooks inside splnet.
with pascoe@
-rw-r--r-- | sys/net/if_vlan.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_carp.c | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 92faeb7dddd..0e0938cdeb8 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.54 2005/04/25 01:34:26 brad Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.55 2005/05/27 08:33:25 mpf Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -499,6 +499,7 @@ vlan_unconfig(struct ifnet *ifp) s = splnet(); LIST_REMOVE(ifv, ifv_list); + hook_disestablish(p->if_linkstatehooks, ifv->lh_cookie); splx(s); /* @@ -512,7 +513,6 @@ vlan_unconfig(struct ifnet *ifp) /* Disconnect from parent. */ ifv->ifv_p = NULL; ifv->ifv_if.if_mtu = ETHERMTU; - hook_disestablish(p->if_linkstatehooks, ifv->lh_cookie); /* Clear our MAC address. */ ifa = ifnet_addrs[ifv->ifv_if.if_index]; diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 5690fc2e8ae..0988de034f1 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.105 2005/04/20 23:00:41 mpf Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.106 2005/05/27 08:33:25 mpf Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -756,6 +756,7 @@ void carpdetach(struct carp_softc *sc) { struct carp_if *cif; + int s; timeout_del(&sc->sc_ad_tmo); timeout_del(&sc->sc_md_tmo); @@ -774,6 +775,7 @@ carpdetach(struct carp_softc *sc) carp_setrun(sc, 0); carp_multicast_cleanup(sc); + s = splnet(); if (sc->sc_carpdev != NULL) { hook_disestablish(sc->sc_carpdev->if_linkstatehooks, sc->lh_cookie); @@ -786,6 +788,7 @@ carpdetach(struct carp_softc *sc) } } sc->sc_carpdev = NULL; + splx(s); } /* Detach an interface from the carp. */ @@ -1408,6 +1411,7 @@ carp_set_ifp(struct carp_softc *sc, struct ifnet *ifp) struct carp_if *cif, *ncif = NULL; struct carp_softc *vr, *after = NULL; int myself = 0, error = 0; + int s; if (ifp == sc->sc_carpdev) return (0); @@ -1485,9 +1489,11 @@ carp_set_ifp(struct carp_softc *sc, struct ifnet *ifp) if (sc->sc_naddrs || sc->sc_naddrs6) sc->sc_if.if_flags |= IFF_UP; carp_set_enaddr(sc); + s = splnet(); sc->lh_cookie = hook_establish(ifp->if_linkstatehooks, 1, carp_carpdev_state, ifp); carp_carpdev_state(ifp); + splx(s); } else { carpdetach(sc); sc->sc_if.if_flags &= ~(IFF_UP|IFF_RUNNING); |