batman-adv: Refresh patches with quilt
[feed/routing.git] / batman-adv / patches / 0026-batman-adv-mcast-TT-fix-wrongly-dropped-or-rerouted-.patch
1 From: Linus Lüssing <linus.luessing@c0d3.blue>
2 Date: Fri, 4 Sep 2020 20:28:00 +0200
3 Subject: batman-adv: mcast/TT: fix wrongly dropped or rerouted packets
4
5 The unicast packet rerouting code makes several assumptions. For
6 instance it assumes that there is always exactly one destination in the
7 TT. This breaks for multicast frames in a unicast packets in several ways:
8
9 For one thing if there is actually no TT entry and the destination node
10 was selected due to the multicast tvlv flags it announced. Then an
11 intermediate node will wrongly drop the packet.
12
13 For another thing if there is a TT entry but the TTVN of this entry is
14 newer than the originally addressed destination node: Then the
15 intermediate node will wrongly redirect the packet, leading to
16 duplicated multicast packets at a multicast listener and missing
17 packets at other multicast listeners or multicast routers.
18
19 Fixing this by not applying the unicast packet rerouting to batman-adv
20 unicast packets with a multicast payload. We are not able to detect a
21 roaming multicast listener at the moment and will just continue to send
22 the multicast frame to both the new and old destination for a while in
23 case of such a roaming multicast listener.
24
25 Fixes: cea194d90b11 ("batman-adv: improved client announcement mechanism")
26 Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
27 Signed-off-by: Sven Eckelmann <sven@narfation.org>
28
29 Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/22e740c5e6c9342e0f5028beb3d14b84a018d113
30
31 --- a/net/batman-adv/routing.c
32 +++ b/net/batman-adv/routing.c
33 @@ -826,6 +826,10 @@ static bool batadv_check_unicast_ttvn(st
34 vid = batadv_get_vid(skb, hdr_len);
35 ethhdr = (struct ethhdr *)(skb->data + hdr_len);
36
37 + /* do not reroute multicast frames in a unicast header */
38 + if (is_multicast_ether_addr(ethhdr->h_dest))
39 + return true;
40 +
41 /* check if the destination client was served by this node and it is now
42 * roaming. In this case, it means that the node has got a ROAM_ADV
43 * message and that it knows the new destination in the mesh to re-route