diff mbox

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

Message ID 20150910160039.4fcf270451cd2f3891ecdaf7@ubnt.com
State Rejected
Headers show

Commit Message

Dmitry Ivanov Sept. 10, 2015, 1 p.m. UTC
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@ubnt.com>
---
 system-linux.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Jonas Gorski Sept. 10, 2015, 1:20 p.m. UTC | #1
Hi,

On Thu, Sep 10, 2015 at 3:00 PM, Dmitry Ivanov
<dmitrijs.ivanovs@ubnt.com> wrote:
> 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@ubnt.com>

Commit subject/message does not match what the patch does:

> ---
>  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;

hairpin mode will already be disabled if macst_to_ucast is disabled.

What this patch does is change the default of multicast to unicast to
off. Changing the default of hairpin mode to off is only a side effect
of that.


Jonas
Linus Lüssing Sept. 10, 2015, 1:39 p.m. UTC | #2
Hi Dmitry,

On Thu, Sep 10, 2015 at 04:00:39PM +0300, Dmitry Ivanov wrote:
> [...] Enabling this mode leads to broadcast frames such as ARP and DHCP
> being retransmitted back to AP in WDS configurations.

Could you eloborate a little more on this? For a normal
bridge-on-AP setting this should be fine together with the
ap-isolation. But I'm not that familiar with WDS, I have to admit.

Do you see duplicate broadcast packets or echoes on the
transmitter? Or what is the issue?

Cheers, Linus
Dmitry Ivanov Sept. 10, 2015, 1:50 p.m. UTC | #3
Hi Linus!

In WDS mode, we have problems with ARP, DHCP and some other protocols
utilizing broadcast frames. So I think it's better to disable
multicast_to_unicast by default in both netifd and script.

On Thu, Sep 10, 2015 at 4:39 PM, Linus Lüssing <linus.luessing@c0d3.blue> wrote:
> Hi Dmitry,
>
> On Thu, Sep 10, 2015 at 04:00:39PM +0300, Dmitry Ivanov wrote:
>> [...] Enabling this mode leads to broadcast frames such as ARP and DHCP
>> being retransmitted back to AP in WDS configurations.
>
> Could you eloborate a little more on this? For a normal
> bridge-on-AP setting this should be fine together with the
> ap-isolation. But I'm not that familiar with WDS, I have to admit.
>
> Do you see duplicate broadcast packets or echoes on the
> transmitter? Or what is the issue?
>
> Cheers, Linus
diff mbox

Patch

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;