aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2011-10-21 18:55:39 -0400
committerMarek Lindner <lindner_marek@yahoo.de>2011-10-25 08:23:05 -0400
commit93840ac40bb0d0f177ef8af74e64671be67e8c37 (patch)
tree3dd927a278ab6bd234520babaa5e8ddfbe4b276b /net
parent6e8014947d6469df1566e9e253805557c5c0e4e0 (diff)
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: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/types.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 25bd1db35370..51a0db7f6449 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -223,22 +223,22 @@ struct socket_packet {
223 223
224struct tt_local_entry { 224struct tt_local_entry {
225 uint8_t addr[ETH_ALEN]; 225 uint8_t addr[ETH_ALEN];
226 struct hlist_node hash_entry;
226 unsigned long last_seen; 227 unsigned long last_seen;
227 uint16_t flags; 228 uint16_t flags;
228 atomic_t refcount; 229 atomic_t refcount;
229 struct rcu_head rcu; 230 struct rcu_head rcu;
230 struct hlist_node hash_entry;
231}; 231};
232 232
233struct tt_global_entry { 233struct tt_global_entry {
234 uint8_t addr[ETH_ALEN]; 234 uint8_t addr[ETH_ALEN];
235 struct hlist_node hash_entry; /* entry in the global table */
235 struct orig_node *orig_node; 236 struct orig_node *orig_node;
236 uint8_t ttvn; 237 uint8_t ttvn;
237 uint16_t flags; /* only TT_GLOBAL_ROAM is used */ 238 uint16_t flags; /* only TT_GLOBAL_ROAM is used */
238 unsigned long roam_at; /* time at which TT_GLOBAL_ROAM was set */ 239 unsigned long roam_at; /* time at which TT_GLOBAL_ROAM was set */
239 atomic_t refcount; 240 atomic_t refcount;
240 struct rcu_head rcu; 241 struct rcu_head rcu;
241 struct hlist_node hash_entry; /* entry in the global table */
242}; 242};
243 243
244struct tt_change_node { 244struct tt_change_node {