diff options
author | 2016-11-22 23:23:12 +0000 | |
---|---|---|
committer | 2016-11-22 23:23:12 +0000 | |
commit | a82aca11faa988c1a80e0eb8b408093f4a49c5b9 (patch) | |
tree | 729b09787c2dff438d9e027c5afe62216969c12b | |
parent | Don't attempt to call vm_remove() with a NULL vm: some functions like (diff) | |
download | wireguard-openbsd-a82aca11faa988c1a80e0eb8b408093f4a49c5b9.tar.xz wireguard-openbsd-a82aca11faa988c1a80e0eb8b408093f4a49c5b9.zip |
Fix panic on detach hook when interfaces get destroyed.
ok reyk@
-rw-r--r-- | sys/net/if_switch.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if_switch.c b/sys/net/if_switch.c index c27edd1601c..e717b7885de 100644 --- a/sys/net/if_switch.c +++ b/sys/net/if_switch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_switch.c,v 1.14 2016/11/20 12:45:26 reyk Exp $ */ +/* $OpenBSD: if_switch.c,v 1.15 2016/11/22 23:23:12 rzalamena Exp $ */ /* * Copyright (c) 2016 Kazuya GODA <goda@openbsd.org> @@ -625,10 +625,11 @@ void switch_port_detach(void *arg) { struct ifnet *ifp = (struct ifnet *)arg; - struct switch_softc *sc = ifp->if_softc; + struct switch_softc *sc; struct switch_port *swpo; swpo = (struct switch_port *)ifp->if_switchport; + sc = swpo->swpo_switch; if (swpo->swpo_flags & IFBIF_LOCAL) switch_port_unset_local(sc, swpo); |