batman-adv: Fix own OGM check in aggregated OGMs
authorLinus Lüssing <linus.luessing@c0d3.blue>
Sat, 20 Nov 2021 12:39:53 +0000 (13:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 10:48:43 +0000 (11:48 +0100)
commitc36d7d5c87847a67fdb035f5021b7a714c03b72f
tree007fc56a0ca8cbc48680dfda34054a31a96fa368
parent8bfeeb157006b8ccc5a099cc9df1258baeb5638e
batman-adv: Fix own OGM check in aggregated OGMs

commit d8bf0c01642275c7dca1e5d02c34e4199c200b1f upstream.

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: Simon Wunderlich <sw@simonwunderlich.de>
[ bp: 4.9 backported: adjust context, correct fixes line ]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/batman-adv/bat_v_ogm.c