aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>2012-01-22 20:00:24 +0100
committerAntonio Quartulli <ordex@autistici.org>2012-04-11 14:28:59 +0200
commitfe2da6ff27c73c1d102ec2189f94e8bc729d1a9b (patch)
tree143055e9de797c3b645d453a5d0c62d5c3d8af19 /net/batman-adv/types.h
parentbatman-adv: don't let backbone gateways exchange tt entries (diff)
downloadlinux-dev-fe2da6ff27c73c1d102ec2189f94e8bc729d1a9b.tar.xz
linux-dev-fe2da6ff27c73c1d102ec2189f94e8bc729d1a9b.zip
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>
Diffstat (limited to '')
-rw-r--r--net/batman-adv/types.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 35cd831508a9..ad97e87a2e22 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -140,6 +140,11 @@ struct neigh_node {
spinlock_t tq_lock; /* protects: tq_recv, tq_index */
};
+struct bcast_duplist_entry {
+ uint8_t orig[ETH_ALEN];
+ uint16_t crc;
+ unsigned long entrytime;
+};
struct bat_priv {
atomic_t mesh_state;
@@ -186,6 +191,8 @@ struct bat_priv {
struct list_head tt_req_list; /* list of pending tt_requests */
struct list_head tt_roam_list;
struct hashtable_t *vis_hash;
+ struct bcast_duplist_entry bcast_duplist[DUPLIST_SIZE];
+ int bcast_duplist_curr;
spinlock_t forw_bat_list_lock; /* protects forw_bat_list */
spinlock_t forw_bcast_list_lock; /* protects */
spinlock_t tt_changes_list_lock; /* protects tt_changes */