summaryrefslogtreecommitdiffhomepage
path: root/system-linux.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2016-09-13 14:33:38 +0200
committerFelix Fietkau <nbd@nbd.name>2016-09-14 12:59:37 +0200
commit83d3a901d3178a8840092b6e4f7f829b89da4ba0 (patch)
tree557e504bc0756daafbf32999049f8a3ee418ffba /system-linux.c
parent8bf5df1d052a853579c0474dabc87af2d113fb53 (diff)
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 <dedeckeh@gmail.com>
Diffstat (limited to 'system-linux.c')
-rw-r--r--system-linux.c9
1 files changed, 9 insertions, 0 deletions
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");