From fe2da6ff27c73c1d102ec2189f94e8bc729d1a9b Mon Sep 17 00:00:00 2001 From: Simon Wunderlich Date: Sun, 22 Jan 2012 20:00:24 +0100 Subject: 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 Signed-off-by: Antonio Quartulli --- net/batman-adv/routing.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net/batman-adv/routing.c') diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 1d1fd04c9c3a..78eddc9067e6 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -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); -- cgit v1.2.3