]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: Add inconsistent hardif netlink dump detection
authorSven Eckelmann <sven@narfation.org>
Tue, 30 Oct 2018 21:01:24 +0000 (22:01 +0100)
committerSimon Wunderlich <sw@simonwunderlich.de>
Mon, 12 Nov 2018 09:41:51 +0000 (10:41 +0100)
commit50d1692700b6905bf421955aca2ac6c71faf055f
tree179a1043fce3fed4bd1741b9cbb6f2425ceecfee
parent9addc060353f1b0d92845f00b1b83afc63b5679b
batman-adv: Add inconsistent hardif 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 49781308500d ("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>
net/batman-adv/hard-interface.c
net/batman-adv/main.c
net/batman-adv/main.h
net/batman-adv/netlink.c