Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
commit 6846ad869ff55346cb572e90fb5fb9440c60061f Merge: 5c11589 2dd1d9f Author: Marek Lindner mareklindner@neomailbox.ch Date: Sun Sep 6 16:25:32 2015 +0800
Merge branch 'maint' into next
6846ad869ff55346cb572e90fb5fb9440c60061f net/batman-adv/routing.c | 19 +++++++++++++++---- net/batman-adv/translation-table.c | 24 +++++++++++++++++++++--- 2 files changed, 36 insertions(+), 7 deletions(-)
diff --cc net/batman-adv/routing.c index 8d990b0,96b5daa..3207667 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@@ -833,9 -833,10 +833,10 @@@ int batadv_recv_unicast_packet(struct s struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); struct batadv_unicast_packet *unicast_packet; struct batadv_unicast_4addr_packet *unicast_4addr_packet; - uint8_t *orig_addr; + u8 *orig_addr; struct batadv_orig_node *orig_node = NULL; int check, hdr_size = sizeof(*unicast_packet); + enum batadv_subtype subtype; bool is4addr;
unicast_packet = (struct batadv_unicast_packet *)skb->data; diff --cc net/batman-adv/translation-table.c index 4228b10,7e4657e..dc422be --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@@ -2411,8 -2394,8 +2417,8 @@@ static bool batadv_tt_global_check_crc( { struct batadv_tvlv_tt_vlan_data *tt_vlan_tmp; struct batadv_orig_node_vlan *vlan; + int i, orig_num_vlan; - uint32_t crc; + u32 crc; - int i;
/* check if each received CRC matches the locally stored one */ for (i = 0; i < num_vlan; i++) { @@@ -2438,6 -2421,18 +2444,18 @@@ return false; }
+ /* check if any excess VLANs exist locally for the originator + * which are not mentioned in the TVLV from the originator. + */ + rcu_read_lock(); + orig_num_vlan = 0; - list_for_each_entry_rcu(vlan, &orig_node->vlan_list, list) ++ hlist_for_each_entry_rcu(vlan, &orig_node->vlan_list, list) + orig_num_vlan++; + rcu_read_unlock(); + + if (orig_num_vlan > num_vlan) + return false; + return true; }