Commit 93840ac4 authored by Antonio Quartulli's avatar Antonio Quartulli Committed by Marek Lindner

batman-adv: unify hash_entry field position in tt_local/global_entry

Function tt_response_fill_table() actually uses a tt_local_entry pointer to
iterate either over the local or the global table entries (it depends on the
what hash table is passed as argument). To iterate over such entries the
hlist_for_each_entry_rcu() macro has to access their "hash_entry" field which
MUST be at the same position in both the tt_global/local_entry structures.
Reported-by: default avatarSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: default avatarAntonio Quartulli <ordex@autistici.org>
Signed-off-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
parent 6e801494
...@@ -223,22 +223,22 @@ struct socket_packet { ...@@ -223,22 +223,22 @@ struct socket_packet {
struct tt_local_entry { struct tt_local_entry {
uint8_t addr[ETH_ALEN]; uint8_t addr[ETH_ALEN];
struct hlist_node hash_entry;
unsigned long last_seen; unsigned long last_seen;
uint16_t flags; uint16_t flags;
atomic_t refcount; atomic_t refcount;
struct rcu_head rcu; struct rcu_head rcu;
struct hlist_node hash_entry;
}; };
struct tt_global_entry { struct tt_global_entry {
uint8_t addr[ETH_ALEN]; uint8_t addr[ETH_ALEN];
struct hlist_node hash_entry; /* entry in the global table */
struct orig_node *orig_node; struct orig_node *orig_node;
uint8_t ttvn; uint8_t ttvn;
uint16_t flags; /* only TT_GLOBAL_ROAM is used */ uint16_t flags; /* only TT_GLOBAL_ROAM is used */
unsigned long roam_at; /* time at which TT_GLOBAL_ROAM was set */ unsigned long roam_at; /* time at which TT_GLOBAL_ROAM was set */
atomic_t refcount; atomic_t refcount;
struct rcu_head rcu; struct rcu_head rcu;
struct hlist_node hash_entry; /* entry in the global table */
}; };
struct tt_change_node { struct tt_change_node {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment