diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-12-08 07:02:17 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-12-08 07:02:17 +0000 |
commit | db0ae491d539e3ca683dc81ee095e48c9e3cd0a4 (patch) | |
tree | 3d5691e53ba7ccda26d9888ec3c2b3621e6d225e | |
parent | 306580664beba87a40d32773f4549231cbf70be7 (diff) |
Call if_down() in if_clone_destroy(). Based on diff from Chris Pascoe.
ok markus@
-rw-r--r-- | sys/net/if.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 5e8207a29f4..c57620c5e46 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.98 2004/12/08 06:57:55 mcbride Exp $ */ +/* $OpenBSD: if.c,v 1.99 2004/12/08 07:02:16 mcbride Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -681,6 +681,7 @@ if_clone_destroy(name) { struct if_clone *ifc; struct ifnet *ifp; + int s; ifc = if_clone_lookup(name, NULL); if (ifc == NULL) @@ -693,6 +694,12 @@ if_clone_destroy(name) if (ifc->ifc_destroy == NULL) return (EOPNOTSUPP); + if (ifp->if_flags & IFF_UP) { + s = splimp(); + if_down(ifp); + splx(s); + } + return ((*ifc->ifc_destroy)(ifp)); } |