Skip to contentSkip to conversation

batman-adv: Fix multicast packet loss with a single WANT_ALL_IPV4/6 flag

PATCH Applied Linus Lüssing 2 participants 2 messages Mar 4, 2018 Batman advanced

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 batman-adv: Fix multicast packet loss with a single WANT_ALL_IPV4/6 flag

As the kernel doc describes too the code is supposed to skip adding multicast TT entries if both the WANT_ALL_IPV4 and WANT_ALL_IPV6 flags are present.

Unfortunately, the current code even skips adding multicast TT entries if only either the WANT_ALL_IPV4 or WANT_ALL_IPV6 is present.

This could lead to IPv6 multicast packet loss if only an IGMP but not an MLD querier is present for instance or vice versa.

Fixes 391b59cdb111 ("batman-adv: Add multicast optimization support for bridged setups")

---
v3: Added "Fixes:" line
v2: Fixed typo in last sentence: "non" -> "not"

 net/batman-adv/multicast.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/batman-adv/multicast.c +2 -2
index 6eaffe50..15a7b314 100644
@@ -543,8 +543,8 @@ static bool batadv_mcast_mla_tvlv_update(struct batadv_priv *bat_priv)
 		bat_priv->mcast.enabled = true;
 	}
 
-	return !(mcast_data.flags &
-		 (BATADV_MCAST_WANT_ALL_IPV4 | BATADV_MCAST_WANT_ALL_IPV6));
+	return !(mcast_data.flags & BATADV_MCAST_WANT_ALL_IPV4 &&
+		 mcast_data.flags & BATADV_MCAST_WANT_ALL_IPV6);
 }
 
 /**
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw
Quoted 4 lines · On Sonntag, 4. März 2018 13:08:17 CET Linus Lüssing wrote:

As the kernel doc describes too the code is supposed to skip adding multicast TT entries if both the WANT_ALL_IPV4 and WANT_ALL_IPV6 flags are present.

Quoted 8 lines

Unfortunately, the current code even skips adding multicast TT entries if only either the WANT_ALL_IPV4 or WANT_ALL_IPV6 is present.

This could lead to IPv6 multicast packet loss if only an IGMP but not an MLD querier is present for instance or vice versa.

Fixes 391b59cdb111 ("batman-adv: Add multicast optimization support for bridged setups")

Applied in edba00d56efb [1].

Thanks,
Sven

[1] https://git.open-mesh.org/batman-adv.git/commit/edba00d56efb1d55cdd40957e010fba80580b5e2