source: packages/net/batman-adv/patches/0001-batman-adv_unify_hash_entry_field_position_in_tt_local_global_entry.patch @ 28575

Last change on this file since 28575 was 28575, checked in by marek, 5 years ago

batman-adv: bugfixes for the 2011.3.1 release

Signed-off-by: Marek Lindner <lindner_marek@…>

File size: 1.2 KB
  • types.h

    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>
    ---
     types.h |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
    
    a b struct socket_packet { 
    224224 
    225225struct tt_local_entry { 
    226226        uint8_t addr[ETH_ALEN]; 
     227        struct hlist_node hash_entry; 
    227228        unsigned long last_seen; 
    228229        uint16_t flags; 
    229230        atomic_t refcount; 
    230231        struct rcu_head rcu; 
    231         struct hlist_node hash_entry; 
    232232}; 
    233233 
    234234struct tt_global_entry { 
    235235        uint8_t addr[ETH_ALEN]; 
     236        struct hlist_node hash_entry; /* entry in the global table */ 
    236237        struct orig_node *orig_node; 
    237238        uint8_t ttvn; 
    238239        uint16_t flags; /* only TT_GLOBAL_ROAM is used */ 
    239240        unsigned long roam_at; /* time at which TT_GLOBAL_ROAM was set */ 
    240241        atomic_t refcount; 
    241242        struct rcu_head rcu; 
    242         struct hlist_node hash_entry; /* entry in the global table */ 
    243243}; 
    244244 
    245245struct tt_change_node { 
Note: See TracBrowser for help on using the repository browser.