summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2019-06-09 17:42:17 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2019-06-09 17:42:17 +0000
commitbd4db8cf7a70a48539ac74a2c1d358f4272386be (patch)
tree3d1bc36b28b462e4cb5cedcce8415fa2158bdc20 /sys
parentaf72230377d544577f6f07024de504a35819edc7 (diff)
Always return EEXIST if an interface is already part of a bridge.
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_bridge.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 44f0d9cc3c1..882eb9c3283 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.334 2019/06/09 17:40:34 mpi Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.335 2019/06/09 17:42:16 mpi Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -361,7 +361,10 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
}
if (ifs->if_bridgeidx != 0) {
- error = EBUSY;
+ if (ifs->if_bridgeidx == ifp->if_index)
+ error = EEXIST;
+ else
+ error = EBUSY;
break;
}
SMR_SLIST_FOREACH_LOCKED(bif, &sc->sc_spanlist, bif_next) {