batman-adv: fix tt_local_reset_flags() function

Message ID 1318249188-14954-1-git-send-email-ordex@autistici.org (mailing list archive)
State Superseded, archived
Commit d1b1d7c61046afc9288d1e6c89f27839a588bd7b
Headers

Commit Message

Antonio Quartulli Oct. 10, 2011, 12:19 p.m. UTC
  tt_local_num has to be increased only the when flag passed as argument is reset

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---

This patch should fix the aforementioned bug. Please the testers to give it a
try :-) We are waiting for feedbacks!

 translation-table.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
  

Patch

diff --git a/translation-table.c b/translation-table.c
index 7de9960..8451ecd 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -1723,6 +1723,8 @@  static void tt_local_reset_flags(struct bat_priv *bat_priv, uint16_t flags)
 		rcu_read_lock();
 		hlist_for_each_entry_rcu(tt_local_entry, node,
 					 head, hash_entry) {
+			if (!(tt_local_entry->flags & flags))
+				continue;
 			tt_local_entry->flags &= ~flags;
 			atomic_inc(&bat_priv->num_local_tt);
 		}