X-Git-Url: http://git.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=system-linux.c;h=a0389879c4d47c7a8ec8769b362aeb2cd1acb07f;hp=eb785b56395caa03d102276e3973a974719933ee;hb=6cf66bb0a02f3993394c0408c2865bfaf2756f21;hpb=ca2f99575937b183618e425a73b45bcc277b5541 diff --git a/system-linux.c b/system-linux.c index eb785b5..a038987 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); @@ -548,7 +553,7 @@ handle_hotplug_msg(char *data, int size) return; found: - dev = device_get(interface, false); + dev = device_find(interface); if (!dev) return; @@ -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"); @@ -2480,6 +2489,8 @@ int system_update_ipv6_mtu(struct device *dev, int mtu) dev->ifname); int fd = open(buf, O_RDWR); + if (fd < 0) + return ret; if (!mtu) { ssize_t len = read(fd, buf, sizeof(buf) - 1);