310e2816e632dc64623cc5f15396a4003d8ec3cb
[openwrt/svn-archive/archive.git] / net / batman-adv / patches / 0001-batman-adv_unify_hash_entry_field_position_in_tt_local_global_entry.patch
1
2 Function tt_response_fill_table() actually uses a tt_local_entry pointer to
3 iterate either over the local or the global table entries (it depends on the
4 what hash table is passed as argument). To iterate over such entries the
5 hlist_for_each_entry_rcu() macro has to access their "hash_entry" field which
6 MUST be at the same position in both the tt_global/local_entry structures.
7
8 Reported-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
9 Signed-off-by: Antonio Quartulli <ordex@autistici.org>
10 ---
11 types.h | 4 ++--
12 1 files changed, 2 insertions(+), 2 deletions(-)
13
14 --- a/types.h
15 +++ b/types.h
16 @@ -224,22 +224,22 @@ struct socket_packet {
17
18 struct tt_local_entry {
19 uint8_t addr[ETH_ALEN];
20 + struct hlist_node hash_entry;
21 unsigned long last_seen;
22 uint16_t flags;
23 atomic_t refcount;
24 struct rcu_head rcu;
25 - struct hlist_node hash_entry;
26 };
27
28 struct tt_global_entry {
29 uint8_t addr[ETH_ALEN];
30 + struct hlist_node hash_entry; /* entry in the global table */
31 struct orig_node *orig_node;
32 uint8_t ttvn;
33 uint16_t flags; /* only TT_GLOBAL_ROAM is used */
34 unsigned long roam_at; /* time at which TT_GLOBAL_ROAM was set */
35 atomic_t refcount;
36 struct rcu_head rcu;
37 - struct hlist_node hash_entry; /* entry in the global table */
38 };
39
40 struct tt_change_node {
41