batman-adv: Refresh patches
[feed/routing.git] / batman-adv / patches / 0044-batman-adv-Avoid-storing-non-TT-sync-flags-on-singul.patch
1 From: Linus Lüssing <linus.luessing@c0d3.blue>
2 Date: Thu, 7 Jun 2018 00:46:23 +0200
3 Subject: batman-adv: Avoid storing non-TT-sync flags on singular entries too
4
5 Since commit 382d020fe3fa ("batman-adv: fix TT sync flag inconsistencies")
6 TT sync flags and TT non-sync'd flags are supposed to be stored
7 separately.
8
9 The previous patch missed to apply this separation on a TT entry with
10 only a single TT orig entry.
11
12 This is a minor fix because with only a single TT orig entry the DDoS
13 issue the former patch solves does not apply.
14
15 Fixes: 382d020fe3fa ("batman-adv: fix TT sync flag inconsistencies")
16 Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
17 Signed-off-by: Sven Eckelmann <sven@narfation.org>
18
19 Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/beb6246b2339852b6a429ae9259a8eb30a685041
20
21 diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
22 index 743963bf39dca73f7554f9f85fffd57fd6a3c963..a8b4d9bcb318656022a30f742ede4f38a646d0d1 100644
23 --- a/net/batman-adv/translation-table.c
24 +++ b/net/batman-adv/translation-table.c
25 @@ -1695,7 +1695,8 @@ static bool batadv_tt_global_add(struct batadv_priv *bat_priv,
26 ether_addr_copy(common->addr, tt_addr);
27 common->vid = vid;
28
29 - common->flags = flags;
30 + common->flags = flags & (~BATADV_TT_SYNC_MASK);
31 +
32 tt_global_entry->roam_at = 0;
33 /* node must store current time in case of roaming. This is
34 * needed to purge this entry out on timeout (if nobody claims