Skip to content

Instantly share code, notes, and snippets.

@haught
Created October 14, 2018 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haught/258f70d5026790debb25a175fe96114f to your computer and use it in GitHub Desktop.
Save haught/258f70d5026790debb25a175fe96114f to your computer and use it in GitHub Desktop.
sys/net/if_bridge.c
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index d04b6029983..6b35ebc998a 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -412,6 +412,13 @@ SYSCTL_INT(_net_link_bridge, OID_AUTO, allow_llz_overlap,
"Allow overlap of link-local scope "
"zones of a bridge interface and the member interfaces");
+/* allow reserved multicast through bridge */
+static VNET_DEFINE(int, allow_res_multicast);
+#define V_allow_res_multicast VNET(allow_res_multicast)
+SYSCTL_INT(_net_link_bridge, OID_AUTO, allow_res_multicast,
+ CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(allow_res_multicast), 0,
+ "Allow reserved multicast through bridge");
+
struct bridge_control {
int (*bc_func)(struct bridge_softc *, void *);
int bc_argsize;
@@ -2201,10 +2208,12 @@ bridge_forward(struct bridge_softc *sc, struct bridge_iflist *sbif,
* bridge.
* This is currently 01-80-C2-00-00-00 to 01-80-C2-00-00-0F
*/
- if (dst[0] == 0x01 && dst[1] == 0x80 &&
- dst[2] == 0xc2 && dst[3] == 0x00 &&
- dst[4] == 0x00 && dst[5] <= 0x0f)
- goto drop;
+ if (V_allow_res_multicast == 0) {
+ if (dst[0] == 0x01 && dst[1] == 0x80 &&
+ dst[2] == 0xc2 && dst[3] == 0x00 &&
+ dst[4] == 0x00 && dst[5] <= 0x0f)
+ goto drop;
+ }
/* ...forward it to all interfaces. */
if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment