summaryrefslogtreecommitdiffstats
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2013-07-28 19:49:39 +0000
committerhrs <hrs@FreeBSD.org>2013-07-28 19:49:39 +0000
commitee26f7a25613614a6cad69f72a63b62a890a63c8 (patch)
tree15a0915c286c202a1eb19ffe6d413684857d2b58 /sys/net/if_bridge.c
parent4e6c4b2a3693b3ff3713bff0906a243d1acbc284 (diff)
downloadFreeBSD-src-ee26f7a25613614a6cad69f72a63b62a890a63c8.zip
FreeBSD-src-ee26f7a25613614a6cad69f72a63b62a890a63c8.tar.gz
- Relax the restriction on the member interfaces with LLAs. Two or more
LLAs on the member interfaces are actually harmless when the parent interface does not have a LLA. - Add net.link.bridge.allow_llz_overlap. This is a knob to allow LLAs on a bridge and the member interfaces at the same time. The default is 0. Pointed out by: ume MFC after: 3 days
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index b33696f..572ee06 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -382,6 +382,12 @@ SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RW,
&bridge_inherit_mac, 0,
"Inherit MAC address from the first bridge member");
+static VNET_DEFINE(int, allow_llz_overlap) = 0;
+#define V_allow_llz_overlap VNET(allow_llz_overlap)
+SYSCTL_VNET_INT(_net_link_bridge, OID_AUTO, allow_llz_overlap, CTLFLAG_RW,
+ &VNET_NAME(allow_llz_overlap), 0, "Allow overlap of link-local scope "
+ "zones of a bridge interface and the member interfaces");
+
struct bridge_control {
int (*bc_func)(struct bridge_softc *, void *);
int bc_argsize;
@@ -1064,7 +1070,8 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg)
*/
/* Check if the parent interface has a link-local scope addr. */
- if (in6ifa_llaonifp(sc->sc_ifp) != NULL) {
+ if (V_allow_llz_overlap == 0 &&
+ in6ifa_llaonifp(sc->sc_ifp) != NULL) {
/*
* If any, remove all inet6 addresses from the member
* interfaces.
@@ -1093,32 +1100,6 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg)
"IPv6 address scope violation.\n",
ifs->if_xname);
}
- } else {
- struct in6_ifaddr *ia6_m, *ia6_s;
- /*
- * If not, check whether one of the existing member
- * interfaces have inet6 address. If any, remove
- * inet6 addresses on the interface to be added.
- */
- ia6_m = NULL;
- BRIDGE_XLOCK(sc);
- LIST_FOREACH(bif, &sc->sc_iflist, bif_next) {
- ia6_m = in6ifa_llaonifp(bif->bif_ifp);
- if (ia6_m != NULL)
- break;
- }
- BRIDGE_XDROP(sc);
- ia6_s = in6ifa_llaonifp(ifs);
-
- if (ia6_m != NULL && ia6_s != NULL) {
- BRIDGE_UNLOCK(sc);
- in6_ifdetach(ifs);
- BRIDGE_LOCK(sc);
- if_printf(sc->sc_ifp, "IPv6 addresses on %s have "
- "been removed before adding it as a member "
- "to prevent IPv6 address scope violation.\n",
- ifs->if_xname);
- }
}
#endif
/* Allow the first Ethernet member to define the MTU */
OpenPOWER on IntegriCloud