BRIDGE_ATTR_IFNAME,
BRIDGE_ATTR_STP,
BRIDGE_ATTR_FORWARD_DELAY,
+ BRIDGE_ATTR_IGMP_SNOOP,
BRIDGE_ATTR_AGEING_TIME,
BRIDGE_ATTR_HELLO_TIME,
BRIDGE_ATTR_MAX_AGE,
[BRIDGE_ATTR_AGEING_TIME] = { "ageing_time", BLOBMSG_TYPE_INT32 },
[BRIDGE_ATTR_HELLO_TIME] = { "hello_time", BLOBMSG_TYPE_INT32 },
[BRIDGE_ATTR_MAX_AGE] = { "max_age", BLOBMSG_TYPE_INT32 },
+ [BRIDGE_ATTR_IGMP_SNOOP] = { "igmp_snooping", BLOBMSG_TYPE_BOOL },
};
static const union config_param_info bridge_attr_info[__BRIDGE_ATTR_MAX] = {
/* defaults */
cfg->stp = true;
cfg->forward_delay = 1;
+ cfg->igmp_snoop = true;
if ((cur = tb[BRIDGE_ATTR_STP]))
cfg->stp = blobmsg_get_bool(cur);
if ((cur = tb[BRIDGE_ATTR_FORWARD_DELAY]))
cfg->forward_delay = blobmsg_get_u32(cur);
+ if ((cur = tb[BRIDGE_ATTR_IGMP_SNOOP]))
+ cfg->igmp_snoop = blobmsg_get_bool(cur);
+
if ((cur = tb[BRIDGE_ATTR_AGEING_TIME])) {
cfg->ageing_time = blobmsg_get_u32(cur);
cfg->flags |= BRIDGE_OPT_AGEING_TIME;
close(fd);
}
-static void system_set_disable_ipv6(struct device *dev, const char *val)
+static void system_set_dev_sysctl(const char *path, const char *device, const char *val)
{
char buf[256];
- snprintf(buf, sizeof(buf), "/proc/sys/net/ipv6/conf/%s/disable_ipv6", dev->ifname);
- system_set_sysctl(buf, "0");
+ snprintf(buf, sizeof(buf), path, val);
+ system_set_sysctl(buf, val);
+}
+
+static void system_set_disable_ipv6(struct device *dev, const char *val)
+{
+ system_set_dev_sysctl("/proc/sys/net/ipv6/conf/%s/disable_ipv6", dev->ifname, val);
}
// Evaluate netlink messages
args[1] = sec_to_jiffies(cfg->forward_delay);
system_bridge_if(bridge->ifname, NULL, SIOCDEVPRIVATE, &args);
+ system_set_dev_sysctl("/sys/devices/virtual/net/%s/bridge/multicast_snooping",
+ bridge->ifname, cfg->igmp_snoop ? "1" : "0");
+
if (cfg->flags & BRIDGE_OPT_AGEING_TIME) {
args[0] = BRCTL_SET_AGEING_TIME;
args[1] = sec_to_jiffies(cfg->ageing_time);