summaryrefslogtreecommitdiff
path: root/net/batman-adv/hash.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2018-10-30 22:01:25 +0100
committerSimon Wunderlich <sw@simonwunderlich.de>2018-11-12 10:41:51 +0100
commit05abd7bcc9cdbedf9deff27fe0766c70c4f2ae0d (patch)
treec389b27c0b16e602363268f48f34f0188e1d912f /net/batman-adv/hash.c
parentfb69be697916a2d0a9badcdef7f20fcfad1233bc (diff)
batman-adv: Store modification counter via hash helpers
Multiple datastructures use the hash helper functions to add and remove entries from the simple hlist based hashes. These are often also dumped to userspace via netlink and thus should have a generation sequence counter. Reported-by: Matthias Schiffer <mschiffer@universe-factory.net> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/hash.c')
-rw-r--r--net/batman-adv/hash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/batman-adv/hash.c b/net/batman-adv/hash.c
index 7b49e4001778..9194f4d891b1 100644
--- a/net/batman-adv/hash.c
+++ b/net/batman-adv/hash.c
@@ -32,6 +32,8 @@ static void batadv_hash_init(struct batadv_hashtable *hash)
INIT_HLIST_HEAD(&hash->table[i]);
spin_lock_init(&hash->list_locks[i]);
}
+
+ atomic_set(&hash->generation, 0);
}
/**