summaryrefslogtreecommitdiff
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorCamiel Dobbelaar <camield@cvs.openbsd.org>2012-12-22 13:20:33 +0000
committerCamiel Dobbelaar <camield@cvs.openbsd.org>2012-12-22 13:20:33 +0000
commitf3c1a1f4ce31c91b1161aafc9edb1382b0145cf4 (patch)
tree0ea76107438c679446fdd4d95681866e68bcc553 /sys/net/if_bridge.c
parent7f1c2f6cd62f9dc8b603f387bfee1d4015b21ced (diff)
Return EEXIST to 'add' when a port is already a bridge member. This makes
reconfiguration with /etc/netstart silent again. (noticed by deraadt) And do the same for 'addspan'. ok deraadt
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 67a57b1a443..b6493044028 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.203 2012/12/07 23:52:09 weerd Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.204 2012/12/22 13:20:32 camield Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -310,7 +310,11 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
}
if (ifs->if_bridgeport != NULL) {
- error = EBUSY;
+ p = (struct bridge_iflist *)ifs->if_bridgeport;
+ if (p->bridge_sc == sc)
+ error = EEXIST;
+ else
+ error = EBUSY;
break;
}
@@ -422,7 +426,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
}
if (p != LIST_END(&sc->sc_spanlist)) {
- error = EBUSY;
+ error = EEXIST;
break;
}
p = malloc(sizeof(*p), M_DEVBUF, M_NOWAIT|M_ZERO);