make ipv6only plugin option boolean. Without this, the value will be written as ...
[feed/routing.git] / batman-adv / patches / 0014-batman-adv-Fix-broken-DAT-capability-check.patch
1 From de4666781c5a64cd55aa6688f77de95f8f66b2c0 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
3 Date: Fri, 3 Jul 2015 18:29:56 +0200
4 Subject: [PATCH 14/17] batman-adv: Fix broken DAT capability check
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 The introduction of set_bit() and clear_bit() calls in batman-adv
10 wrongly passed bitmasks and not the bit numbers to these functions.
11 This leads to broken capability checks.
12
13 Fixing this by making the capability enum a non-bitmasked one and by
14 that passing non-masked values to set_bit()/clear_bit().
15
16 Fixes: bfd0fbaef270 ("batman-adv: Make DAT capability changes atomic")
17 Reported-by: Def <def@laposte.net>
18 Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
19 Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
20 ---
21 distributed-arp-table.c | 2 +-
22 types.h | 2 +-
23 2 files changed, 2 insertions(+), 2 deletions(-)
24
25 diff --git a/distributed-arp-table.c b/distributed-arp-table.c
26 index b2cc19b..c0c514d 100644
27 --- a/distributed-arp-table.c
28 +++ b/distributed-arp-table.c
29 @@ -422,7 +422,7 @@ static bool batadv_is_orig_node_eligible(struct batadv_dat_candidate *res,
30 int j;
31
32 /* check if orig node candidate is running DAT */
33 - if (!(candidate->capabilities & BATADV_ORIG_CAPA_HAS_DAT))
34 + if (!(test_bit(BATADV_ORIG_CAPA_HAS_DAT, &candidate->capabilities)))
35 goto out;
36
37 /* Check if this node has already been selected... */
38 diff --git a/types.h b/types.h
39 index 65dc6bf..08a6343 100644
40 --- a/types.h
41 +++ b/types.h
42 @@ -299,7 +299,7 @@ struct batadv_orig_node {
43 * (= orig node announces a tvlv of type BATADV_TVLV_MCAST)
44 */
45 enum batadv_orig_capabilities {
46 - BATADV_ORIG_CAPA_HAS_DAT = BIT(0),
47 + BATADV_ORIG_CAPA_HAS_DAT,
48 BATADV_ORIG_CAPA_HAS_NC = BIT(1),
49 BATADV_ORIG_CAPA_HAS_TT = BIT(2),
50 BATADV_ORIG_CAPA_HAS_MCAST = BIT(3),
51 --
52 2.1.4
53