So far, neighbour's secondary interface OGMs can involuntarily piggyback on primary interface OGMs that arrived on the same secondary interface before. Secondary interface OGMs should NEVER leave their direct neighbour broadcast domain! This patch ensures that secondary interface OGMs can only be aggregated to other secondary interface OGMs.
Signed-off-by: Linus Lüssing linus.luessing@web.de --- aggregation.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/batman-adv-kernelland/aggregation.c b/batman-adv-kernelland/aggregation.c index 0635b5a..567c31a 100644 --- a/batman-adv-kernelland/aggregation.c +++ b/batman-adv-kernelland/aggregation.c @@ -81,9 +81,15 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet, * interface only - we still can aggregate */ if ((directlink) && (new_batman_packet->ttl == 1) && - (forw_packet->if_incoming == if_incoming)) + (forw_packet->if_incoming == if_incoming) && + + /* packets from direct neighbors or + * own secondary interface packets + * (= secondary interface packets in general) */ + (batman_packet->flags & DIRECTLINK || + (forw_packet->own && + forw_packet->if_incoming->if_num != 0))) return true; - }
return false;