batman-adv: add broadcast duplicate check

When multiple backbone gateways relay the same broadcast from the
backbone into the mesh, other nodes in the mesh may receive this
broadcast multiple times. To avoid this, the crc checksums of
received broadcasts are recorded and new broadcast packets with
the same content may be dropped if received by another gateway.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
This commit is contained in:
Simon Wunderlich
2012-01-22 20:00:24 +01:00
committed by Antonio Quartulli
parent 20ff9d593f
commit fe2da6ff27
5 changed files with 91 additions and 0 deletions

View File

@@ -1076,6 +1076,10 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
spin_unlock_bh(&orig_node->bcast_seqno_lock);
/* check whether this has been sent by another originator before */
if (bla_check_bcast_duplist(bat_priv, bcast_packet, hdr_size))
goto out;
/* rebroadcast packet */
add_bcast_packet_to_list(bat_priv, skb, 1);