summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authormvs <mvs@cvs.openbsd.org>2020-07-17 08:56:42 +0000
committermvs <mvs@cvs.openbsd.org>2020-07-17 08:56:42 +0000
commit778f46ba2c8b003d3062ced4d47b16df2400ad5b (patch)
tree5d6511604973668984331669fba82f053ca489d3 /sys/net/if.c
parent1cc824a280e35f9095cfcada0a61fd6a5d6f9a42 (diff)
Check destruction ability before search instance of clone interface.
ok mpi@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 875eb8b30ed..791c4579ddd 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.612 2020/07/10 13:23:34 patrick Exp $ */
+/* $OpenBSD: if.c,v 1.613 2020/07/17 08:56:41 mvs Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1281,13 +1281,13 @@ if_clone_destroy(const char *name)
if (ifc == NULL)
return (EINVAL);
+ if (ifc->ifc_destroy == NULL)
+ return (EOPNOTSUPP);
+
ifp = ifunit(name);
if (ifp == NULL)
return (ENXIO);
- if (ifc->ifc_destroy == NULL)
- return (EOPNOTSUPP);
-
NET_LOCK();
if (ifp->if_flags & IFF_UP) {
int s;