summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2005-06-08 07:36:51 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2005-06-08 07:36:51 +0000
commit01a9dcd38277c6a74e443a1c37da6e00dfde6507 (patch)
tree30c6ce197addcd1e323147d79b935d4b13c8210e
parentbb1da6be536bfafbeaeb6e9f528a005be465dcac (diff)
if a cloned interface's destroy function fails, re-join the interface class
group, spotted by and ok markus
-rw-r--r--sys/net/if.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 879a129ef47..8cc996aa18f 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.131 2005/06/08 06:58:11 henning Exp $ */
+/* $OpenBSD: if.c,v 1.132 2005/06/08 07:36:50 henning Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -703,7 +703,7 @@ if_clone_destroy(const char *name)
{
struct if_clone *ifc;
struct ifnet *ifp;
- int s;
+ int s, ret;
ifc = if_clone_lookup(name, NULL);
if (ifc == NULL)
@@ -724,7 +724,10 @@ if_clone_destroy(const char *name)
if_delgroup(ifp, ifc->ifc_name);
- return ((*ifc->ifc_destroy)(ifp));
+ if ((ret = (*ifc->ifc_destroy)(ifp)) == -1)
+ if_addgroup(ifp, ifc->ifc_name);
+
+ return (ret);
}
/*