summaryrefslogtreecommitdiff
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@cvs.openbsd.org>2015-07-20 22:16:42 +0000
committerRafael Zalamena <rzalamena@cvs.openbsd.org>2015-07-20 22:16:42 +0000
commite092a1e351caa61327936f333a86f2f5805a1207 (patch)
tree39fed8720bfb3c696f0e1217f48828d25cb046e4 /sys/net/if_bridge.c
parent2d0f13ecf87e74292006c8eeb5bfa8f1d482d8f9 (diff)
Implemented MPLS pseudowire (mpw(4)) to be used with VPLS and VPWS.
ok mpi@, claudio@.
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 1feead383c7..094aadb609a 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.255 2015/07/17 18:05:59 mpi Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.256 2015/07/20 22:16:41 rzalamena Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -36,6 +36,7 @@
#include "pf.h"
#include "carp.h"
#include "vlan.h"
+#include "mpw.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -386,6 +387,11 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/* Nothing needed */
}
#endif /* NGIF */
+#if NMPW > 0
+ else if (ifs->if_type == IFT_MPLSTUNNEL) {
+ /* Nothing needed */
+ }
+#endif /* NMPW */
else {
error = EINVAL;
break;
@@ -1032,7 +1038,15 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
(p->bif_flags & IFBIF_STP) &&
(p->bif_state == BSTP_IFSTATE_DISCARDING))
continue;
-
+#if NMPW > 0
+ /*
+ * Split horizon: avoid broadcasting messages from
+ * wire to another wire.
+ */
+ if (ifp->if_type == IFT_MPLSTUNNEL &&
+ dst_if->if_type == IFT_MPLSTUNNEL)
+ continue;
+#endif /* NMPW */
if ((p->bif_flags & IFBIF_DISCOVER) == 0 &&
(m->m_flags & (M_BCAST | M_MCAST)) == 0)
continue;
@@ -1480,7 +1494,15 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *ifp,
*/
if (dst_if->if_index == ifp->if_index)
continue;
-
+#if NMPW > 0
+ /*
+ * Split horizon: avoid broadcasting messages from wire to
+ * another wire.
+ */
+ if (ifp->if_type == IFT_MPLSTUNNEL &&
+ dst_if->if_type == IFT_MPLSTUNNEL)
+ continue;
+#endif /* NMPW */
if (IF_QFULL(&dst_if->if_snd)) {
IF_DROP(&dst_if->if_snd);
sc->sc_if.if_oerrors++;