Skip to content

Commit 61caf3d

Browse files
T-Xsimonwunderlich
authored andcommitted
batman-adv: mcast: detect, distribute and maintain multicast router presence
To be able to apply our group aware multicast optimizations to packets with a scope greater than link-local we need to not only keep track of multicast listeners but also multicast routers. With this patch a node detects the presence of multicast routers on its segment by checking if /proc/sys/net/ipv{4,6}/conf/<bat0|br0(bat)>/mc_forwarding is set for one thing. This option is enabled by multicast routing daemons and needed for the kernel's multicast routing tables to receive and route packets. For another thing if a bridge is configured on top of bat0 then the presence of an IPv6 multicast router behind this bridge is currently detected by checking for an IPv6 multicast "All Routers Address" (ff02::2). This should later be replaced by querying the bridge, which performs proper, RFC4286 compliant Multicast Router Discovery (our simplified approach includes more hosts than necessary, most notably not just multicast routers but also unicast ones and is not applicable for IPv4). If no multicast router is detected then this is signalized via the new BATADV_MCAST_WANT_NO_RTR4 and BATADV_MCAST_WANT_NO_RTR6 multicast tvlv flags. Signed-off-by: Linus Lüssing <[email protected]> Signed-off-by: Sven Eckelmann <[email protected]> Signed-off-by: Simon Wunderlich <[email protected]>
1 parent 3bcacd1 commit 61caf3d

File tree

4 files changed

+399
-54
lines changed

4 files changed

+399
-54
lines changed

include/uapi/linux/batadv_packet.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,20 @@ enum batadv_icmp_packettype {
107107
* @BATADV_MCAST_WANT_ALL_UNSNOOPABLES: we want all packets destined for
108108
* 224.0.0.0/24 or ff02::1
109109
* @BATADV_MCAST_WANT_ALL_IPV4: we want all IPv4 multicast packets
110+
* (both link-local and routable ones)
110111
* @BATADV_MCAST_WANT_ALL_IPV6: we want all IPv6 multicast packets
112+
* (both link-local and routable ones)
113+
* @BATADV_MCAST_WANT_NO_RTR4: we have no IPv4 multicast router and therefore
114+
* only need routable IPv4 multicast packets we signed up for explicitly
115+
* @BATADV_MCAST_WANT_NO_RTR6: we have no IPv6 multicast router and therefore
116+
* only need routable IPv6 multicast packets we signed up for explicitly
111117
*/
112118
enum batadv_mcast_flags {
113119
BATADV_MCAST_WANT_ALL_UNSNOOPABLES = 1UL << 0,
114120
BATADV_MCAST_WANT_ALL_IPV4 = 1UL << 1,
115121
BATADV_MCAST_WANT_ALL_IPV6 = 1UL << 2,
122+
BATADV_MCAST_WANT_NO_RTR4 = 1UL << 3,
123+
BATADV_MCAST_WANT_NO_RTR6 = 1UL << 4,
116124
};
117125

118126
/* tt data subtypes */

0 commit comments

Comments
 (0)