diff options
author | David S. Miller <davem@davemloft.net> | 2015-08-17 23:31:42 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-17 23:31:42 +0200 |
commit | c1f066d4ee0bde4bb0ff4ac295218b631729e0de (patch) | |
tree | e33985e92b07c879a2759f20518887ad8e5af12b /net/batman-adv/gateway_client.c | |
parent | Merge tag 'mac80211-next-for-davem-2015-08-14' of git://git.kernel.org/pub/sc... (diff) | |
parent | batman-adv: Fix potentially broken skb network header access (diff) | |
download | linux-c1f066d4ee0bde4bb0ff4ac295218b631729e0de.tar.xz linux-c1f066d4ee0bde4bb0ff4ac295218b631729e0de.zip |
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
Antonio Quartulli says:
====================
Included changes:
- avoid integer overflow in GW selection routine
- prevent race condition by making capability bit changes atomic (use
clear/set/test_bit)
- fix synchronization issue in mcast tvlv handler
- fix crash on double list removal of TT Request objects
- fix leak by puring packets enqueued for sending upon iface removal
- ensure network header pointer is set in skb
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/batman-adv/gateway_client.c')
-rw-r--r-- | net/batman-adv/gateway_client.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index cffa92dd9877..6012e2b4af4f 100644 --- a/net/batman-adv/gateway_client.c +++ b/net/batman-adv/gateway_client.c @@ -153,15 +153,11 @@ batadv_gw_get_best_gw_node(struct batadv_priv *bat_priv) struct batadv_neigh_node *router; struct batadv_neigh_ifinfo *router_ifinfo; struct batadv_gw_node *gw_node, *curr_gw = NULL; - uint32_t max_gw_factor = 0, tmp_gw_factor = 0; - uint32_t gw_divisor; + uint64_t max_gw_factor = 0, tmp_gw_factor = 0; uint8_t max_tq = 0; uint8_t tq_avg; struct batadv_orig_node *orig_node; - gw_divisor = BATADV_TQ_LOCAL_WINDOW_SIZE * BATADV_TQ_LOCAL_WINDOW_SIZE; - gw_divisor *= 64; - rcu_read_lock(); hlist_for_each_entry_rcu(gw_node, &bat_priv->gw.list, list) { if (gw_node->deleted) @@ -187,7 +183,7 @@ batadv_gw_get_best_gw_node(struct batadv_priv *bat_priv) tmp_gw_factor = tq_avg * tq_avg; tmp_gw_factor *= gw_node->bandwidth_down; tmp_gw_factor *= 100 * 100; - tmp_gw_factor /= gw_divisor; + tmp_gw_factor >>= 18; if ((tmp_gw_factor > max_gw_factor) || ((tmp_gw_factor == max_gw_factor) && |