[2/2] batman-adv: Fix aggregation direct-link bug
Commit Message
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(-)
Comments
And there are two more things I'm wondering about:
- Why should primary interface OGMs from a different originator
which already travelled over 49 hops not be aggregated to other
primary interface OGMs?
- Why should secondary interface OGMs from neighbours not be
aggregated on our own, neighboring secondary interface OGMs?
As far as I can tell, those two combinations are not being
aggregated at the moment. Is there a reason why they shouldn't?
Cheers, Linus
Hi,
thanks for your patch and for testing mine. I applied both of them.
> And there are two more things I'm wondering about:
> - Why should primary interface OGMs from a different originator
> which already travelled over 49 hops not be aggregated to other
> primary interface OGMs?
> - Why should secondary interface OGMs from neighbours not be
> aggregated on our own, neighboring secondary interface OGMs?
> As far as I can tell, those two combinations are not being
> aggregated at the moment. Is there a reason why they shouldn't?
Well, well - we happily apply more of your patches. ;-)
Cheers,
Marek
@@ -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;