From 83d3a901d3178a8840092b6e4f7f829b89da4ba0 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Tue, 13 Sep 2016 14:33:38 +0200 Subject: bridge: Allow setting multicast_fast_leave_option Setting the multicast_fast_leave option of a bridge allows to control the forwarding of multicast traffic when an IGMP/MLD leave is received. In case multicast_leave_option is enabled and a leave is received the multicast membership will immediately be dropped on the bridge port while in the other case the multicast membership will time out in the bridge. This could be usefull in scenarios where explicit multicast membership host tracking is not supported in the upstream network. In this case the multicast stream is still flowing after a leave is received resulting into possible bandwidth saturation on the lan if a new stream is joined as multiple multicast streams are received. Signed-off-by: Hans Dedecker --- system-linux.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'system-linux.c') diff --git a/system-linux.c b/system-linux.c index d868c15..6e4a194 100644 --- a/system-linux.c +++ b/system-linux.c @@ -326,6 +326,11 @@ static void system_bridge_set_multicast_to_unicast(struct device *dev, const cha system_set_dev_sysctl("/sys/class/net/%s/brport/multicast_to_unicast", dev->ifname, val); } +static void system_bridge_set_multicast_fast_leave(struct device *dev, const char *val) +{ + system_set_dev_sysctl("/sys/class/net/%s/brport/multicast_fast_leave", dev->ifname, val); +} + static void system_bridge_set_hairpin_mode(struct device *dev, const char *val) { system_set_dev_sysctl("/sys/class/net/%s/brport/hairpin_mode", dev->ifname, val); @@ -680,6 +685,10 @@ int system_bridge_addif(struct device *bridge, struct device *dev) system_bridge_set_multicast_router(dev, buf, false); } + if (dev->settings.flags & DEV_OPT_MULTICAST_FAST_LEAVE && + dev->settings.multicast_fast_leave) + system_bridge_set_multicast_fast_leave(dev, "1"); + if (dev->settings.flags & DEV_OPT_LEARNING && !dev->settings.learning) system_bridge_set_learning(dev, "0"); -- cgit v1.2.3