batman-adv: Fix own OGM check in aggregated OGMs
authorLinus Lüssing <linus.luessing@c0d3.blue>
Thu, 23 Jul 2020 12:28:08 +0000 (14:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:03:07 +0000 (19:03 +0200)
commit3e0e9d5e20aa6d7381076e28f641091376d72307
tree82febd5d826102e389434793b4756f5c600640ec
parent8ddda2d99d1d9cee1d3601eca3111479e83e423e
batman-adv: Fix own OGM check in aggregated OGMs

[ Upstream commit d8bf0c01642275c7dca1e5d02c34e4199c200b1f ]

The own OGM check is currently misplaced and can lead to the following
issues:

For one thing we might receive an aggregated OGM from a neighbor node
which has our own OGM in the first place. We would then not only skip
our own OGM but erroneously also any other, following OGM in the
aggregate.

For another, we might receive an OGM aggregate which has our own OGM in
a place other then the first one. Then we would wrongly not skip this
OGM, leading to populating the orginator and gateway table with ourself.

Fixes: 9323158ef9f4 ("batman-adv: OGMv2 - implement originators logic")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/batman-adv/bat_v_ogm.c