batman-adv: mcast: add MRD + routable IPv4 multicast with bridges support
authorLinus Lüssing <linus.luessing@c0d3.blue>
Sat, 15 May 2021 15:22:08 +0000 (17:22 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Sun, 30 May 2021 11:38:27 +0000 (13:38 +0200)
commit7a68cc16b82c963c096387917ced11a27c352261
tree1156edaf159c1d8e537a69e265cc6e8ccd810cd5
parent4cbf055002c53c364d1b3275792e4487af76dd2d
batman-adv: mcast: add MRD + routable IPv4 multicast with bridges support

This adds support for routable IPv4 multicast addresses
(224.0.0.0/4, excluding 224.0.0.0/24) in bridged setups.

This utilizes the Multicast Router Discovery (MRD, RFC4286) support
in the Linux bridge. batman-adv will now query the Linux bridge for
IPv4 multicast routers, which the bridge has previously learned about
via MRD.

This allows us to then safely send routable IPv4 multicast packets in
bridged setups to multicast listeners and multicast routers only. Before
we had to flood such packets to avoid potential multicast packet loss to
IPv4 multicast routers, which we were not able to detect before.

With the bridge MRD integration, we are now also able to perform more
fine-grained detection of IPv6 multicast routers in bridged setups:
Before we were "guessing" IPv6 multicast routers by looking up multicast
listeners for the link-local All Routers multicast address (ff02::2),
which every IPv6 multicast router is listening to. However this would
also include more nodes than necessary: For instance nodes which are
just a router for unicast, but not multicast would be included, too.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/multicast.c