[OpenWrt-Devel] [PATCH][netifd] Bridge hairpin mode must be off by default

Dmitry Ivanov dmitrijs.ivanovs at ubnt.com
Thu Sep 10 09:00:39 EDT 2015


Bridge hairpin mode must be off by default when multicast_to_unicast is
off. Enabling this mode leads to broadcast frames such as ARP and DHCP
being retransmitted back to AP in WDS configurations.

Signed-off-by: Dmitry Ivanov <dima at ubnt.com>
---
 system-linux.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/system-linux.c b/system-linux.c
index 01500a5..6994ace 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -576,12 +576,11 @@ static char *system_get_bridge(const char *name, char *buf, int buflen)
 static void
 system_bridge_set_wireless(struct device *bridge, struct device *dev)
 {
-	bool mcast_to_ucast = true;
+	bool mcast_to_ucast = false;
 	bool hairpin = true;
 
-	if (bridge->settings.flags & DEV_OPT_MULTICAST_TO_UNICAST &&
-	    !bridge->settings.multicast_to_unicast)
-		mcast_to_ucast = false;
+	if (bridge->settings.flags & DEV_OPT_MULTICAST_TO_UNICAST)
+		mcast_to_ucast = bridge->settings.multicast_to_unicast;
 
 	if (!mcast_to_ucast || dev->wireless_isolate)
 		hairpin = false;
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list