diff options
author | David S. Miller | 2015-12-16 17:09:40 +0100 |
---|---|---|
committer | David S. Miller | 2015-12-16 17:09:40 +0100 |
commit | 04ad37836cc132a2127d8a7de340ffbc912b2c7d (patch) | |
tree | b4bfac3debd86f270115b7fac431fddbd688b6bf /net/batman-adv/translation-table.c | |
parent | Merge branch 'geneve-udp-port-offload' (diff) | |
parent | batman-adv: lock crc access in bridge loop avoidance (diff) | |
download | kernel-qcow2-linux-04ad37836cc132a2127d8a7de340ffbc912b2c7d.tar.gz kernel-qcow2-linux-04ad37836cc132a2127d8a7de340ffbc912b2c7d.tar.xz kernel-qcow2-linux-04ad37836cc132a2127d8a7de340ffbc912b2c7d.zip |
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
Antonio Quartulli says:
====================
Included changes:
- change my email in MAINTAINERS and Doc files
- create and export list of single hop neighs per interface
- protect CRC in the BLA code by means of its own lock
- minor fixes and code cleanups
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/batman-adv/translation-table.c')
-rw-r--r-- | net/batman-adv/translation-table.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 4228b10c47ea..5cf431177f34 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -1435,7 +1435,7 @@ static bool batadv_tt_global_add(struct batadv_priv *bat_priv, * TT_CLIENT_WIFI, therefore they have to be copied in the * client entry */ - tt_global_entry->common.flags |= flags; + common->flags |= flags; /* If there is the BATADV_TT_CLIENT_ROAM flag set, there is only * one originator left in the list and we previously received a @@ -2411,8 +2411,8 @@ static bool batadv_tt_global_check_crc(struct batadv_orig_node *orig_node, { struct batadv_tvlv_tt_vlan_data *tt_vlan_tmp; struct batadv_orig_node_vlan *vlan; + int i, orig_num_vlan; u32 crc; - int i; /* check if each received CRC matches the locally stored one */ for (i = 0; i < num_vlan; i++) { @@ -2438,6 +2438,18 @@ static bool batadv_tt_global_check_crc(struct batadv_orig_node *orig_node, 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; + 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; } |