summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2018-10-30 22:01:23 +0100
committerSimon Wunderlich <sw@simonwunderlich.de>2018-11-12 10:41:51 +0100
commit9264c85c8b42d76862ae4ed307f4523e8bbab100 (patch)
tree0dbeb5eec786a78ebbd936bdb5a2aa66f41b08cc /net/batman-adv/main.c
parent694127c1dd494d3796e1627389a4cff7ee19e613 (diff)
downloadlinux-9264c85c8b42d76862ae4ed307f4523e8bbab100.tar.gz
linux-9264c85c8b42d76862ae4ed307f4523e8bbab100.tar.bz2
linux-9264c85c8b42d76862ae4ed307f4523e8bbab100.zip
batman-adv: Add inconsistent gateway netlink dump detection
The netlink dump functionality transfers a large number of entries from the kernel to userspace. It is rather likely that the transfer has to interrupted and later continued. During that time, it can happen that either new entries are added or removed. The userspace could than either receive some entries multiple times or miss entries. Commit 670dc2833d14 ("netlink: advertise incomplete dumps") introduced a mechanism to inform userspace about this problem. Userspace can then decide whether it is necessary or not to retry dumping the information again. The netlink dump functions have to be switched to exclusive locks to avoid changes while the current message is prepared. And an external generation sequence counter is introduced which tracks all modifications of the list. 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/main.c')
-rw-r--r--net/batman-adv/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 69c0d85bceb3..c75e47826949 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -186,6 +186,8 @@ int batadv_mesh_init(struct net_device *soft_iface)
INIT_HLIST_HEAD(&bat_priv->softif_vlan_list);
INIT_HLIST_HEAD(&bat_priv->tp_list);
+ bat_priv->gw.generation = 0;
+
ret = batadv_v_mesh_init(bat_priv);
if (ret < 0)
goto err;