]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: avoid potential race condition when adding a new neighbour
authorAntonio Quartulli <antonio@open-mesh.com>
Wed, 29 Jan 2014 10:25:12 +0000 (11:25 +0100)
committerAntonio Quartulli <antonio@meshcoding.com>
Mon, 17 Feb 2014 16:17:01 +0000 (17:17 +0100)
commit42d50171ac00173857d12f6e17b799da03ebc656
tree102dc9b539fb06435727c592c720d17fc62ddbb9
parentef037792a3ea5a07ab152bf295240558500fa537
batman-adv: avoid potential race condition when adding a new neighbour

When adding a new neighbour it is important to atomically
perform the following:
- check if the neighbour already exists
- append the neighbour to the proper list

If the two operations are not performed in an atomic context
it is possible that two concurrent insertions add the same
neighbour twice.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
net/batman-adv/bat_iv_ogm.c
net/batman-adv/originator.c
net/batman-adv/originator.h