[B.A.T.M.A.N.] [PATCH] batman-adv: Fix mcast_flags debugfs output

Linus Lüssing linus.luessing at c0d3.blue
Fri May 13 18:24:33 CEST 2016


We recently switched to the atomic variants set_bit() / clear_bit()
/ test_bit() for originator capabilities.

Unfortunately, this was missed for the new multicast debugfs
entry, resulting in an empty multicast flags table.

Fixing this by using test_bit().

Fixes: f1f0fbb2c956 ("batman-adv: Add debugfs table for mcast flags")
Signed-off-by: Linus Lüssing <linus.luessing at c0d3.blue>
---
 net/batman-adv/multicast.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index abb12f1..2dd5aec 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -1205,12 +1205,12 @@ int batadv_mcast_flags_seq_print_text(struct seq_file *seq, void *offset)
 
 		rcu_read_lock();
 		hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
-			if (!(orig_node->capa_initialized &
-			      BATADV_ORIG_CAPA_HAS_MCAST))
+			if (!test_bit(BATADV_ORIG_CAPA_HAS_MCAST,
+				      &orig_node->capa_initialized))
 				continue;
 
-			if (!(orig_node->capabilities &
-			      BATADV_ORIG_CAPA_HAS_MCAST)) {
+			if (!test_bit(BATADV_ORIG_CAPA_HAS_MCAST,
+				      &orig_node->capabilities)) {
 				seq_printf(seq, "%pM -\n", orig_node->orig);
 				continue;
 			}
-- 
1.7.10.4



More information about the B.A.T.M.A.N mailing list