aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/gateway_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/gateway_client.c')
-rw-r--r--net/batman-adv/gateway_client.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 074107f2cfaa..34f99a46ec1d 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -114,7 +114,6 @@ static struct batadv_gw_node *
114batadv_gw_get_best_gw_node(struct batadv_priv *bat_priv) 114batadv_gw_get_best_gw_node(struct batadv_priv *bat_priv)
115{ 115{
116 struct batadv_neigh_node *router; 116 struct batadv_neigh_node *router;
117 struct hlist_node *node;
118 struct batadv_gw_node *gw_node, *curr_gw = NULL; 117 struct batadv_gw_node *gw_node, *curr_gw = NULL;
119 uint32_t max_gw_factor = 0, tmp_gw_factor = 0; 118 uint32_t max_gw_factor = 0, tmp_gw_factor = 0;
120 uint32_t gw_divisor; 119 uint32_t gw_divisor;
@@ -127,7 +126,7 @@ batadv_gw_get_best_gw_node(struct batadv_priv *bat_priv)
127 gw_divisor *= 64; 126 gw_divisor *= 64;
128 127
129 rcu_read_lock(); 128 rcu_read_lock();
130 hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw.list, list) { 129 hlist_for_each_entry_rcu(gw_node, &bat_priv->gw.list, list) {
131 if (gw_node->deleted) 130 if (gw_node->deleted)
132 continue; 131 continue;
133 132
@@ -344,7 +343,6 @@ void batadv_gw_node_update(struct batadv_priv *bat_priv,
344 struct batadv_orig_node *orig_node, 343 struct batadv_orig_node *orig_node,
345 uint8_t new_gwflags) 344 uint8_t new_gwflags)
346{ 345{
347 struct hlist_node *node;
348 struct batadv_gw_node *gw_node, *curr_gw; 346 struct batadv_gw_node *gw_node, *curr_gw;
349 347
350 /* Note: We don't need a NULL check here, since curr_gw never gets 348 /* Note: We don't need a NULL check here, since curr_gw never gets
@@ -355,7 +353,7 @@ void batadv_gw_node_update(struct batadv_priv *bat_priv,
355 curr_gw = batadv_gw_get_selected_gw_node(bat_priv); 353 curr_gw = batadv_gw_get_selected_gw_node(bat_priv);
356 354
357 rcu_read_lock(); 355 rcu_read_lock();
358 hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw.list, list) { 356 hlist_for_each_entry_rcu(gw_node, &bat_priv->gw.list, list) {
359 if (gw_node->orig_node != orig_node) 357 if (gw_node->orig_node != orig_node)
360 continue; 358 continue;
361 359
@@ -403,7 +401,7 @@ void batadv_gw_node_delete(struct batadv_priv *bat_priv,
403void batadv_gw_node_purge(struct batadv_priv *bat_priv) 401void batadv_gw_node_purge(struct batadv_priv *bat_priv)
404{ 402{
405 struct batadv_gw_node *gw_node, *curr_gw; 403 struct batadv_gw_node *gw_node, *curr_gw;
406 struct hlist_node *node, *node_tmp; 404 struct hlist_node *node_tmp;
407 unsigned long timeout = msecs_to_jiffies(2 * BATADV_PURGE_TIMEOUT); 405 unsigned long timeout = msecs_to_jiffies(2 * BATADV_PURGE_TIMEOUT);
408 int do_deselect = 0; 406 int do_deselect = 0;
409 407
@@ -411,7 +409,7 @@ void batadv_gw_node_purge(struct batadv_priv *bat_priv)
411 409
412 spin_lock_bh(&bat_priv->gw.list_lock); 410 spin_lock_bh(&bat_priv->gw.list_lock);
413 411
414 hlist_for_each_entry_safe(gw_node, node, node_tmp, 412 hlist_for_each_entry_safe(gw_node, node_tmp,
415 &bat_priv->gw.list, list) { 413 &bat_priv->gw.list, list) {
416 if (((!gw_node->deleted) || 414 if (((!gw_node->deleted) ||
417 (time_before(jiffies, gw_node->deleted + timeout))) && 415 (time_before(jiffies, gw_node->deleted + timeout))) &&
@@ -476,7 +474,6 @@ int batadv_gw_client_seq_print_text(struct seq_file *seq, void *offset)
476 struct batadv_priv *bat_priv = netdev_priv(net_dev); 474 struct batadv_priv *bat_priv = netdev_priv(net_dev);
477 struct batadv_hard_iface *primary_if; 475 struct batadv_hard_iface *primary_if;
478 struct batadv_gw_node *gw_node; 476 struct batadv_gw_node *gw_node;
479 struct hlist_node *node;
480 int gw_count = 0; 477 int gw_count = 0;
481 478
482 primary_if = batadv_seq_print_text_primary_if_get(seq); 479 primary_if = batadv_seq_print_text_primary_if_get(seq);
@@ -490,7 +487,7 @@ int batadv_gw_client_seq_print_text(struct seq_file *seq, void *offset)
490 primary_if->net_dev->dev_addr, net_dev->name); 487 primary_if->net_dev->dev_addr, net_dev->name);
491 488
492 rcu_read_lock(); 489 rcu_read_lock();
493 hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw.list, list) { 490 hlist_for_each_entry_rcu(gw_node, &bat_priv->gw.list, list) {
494 if (gw_node->deleted) 491 if (gw_node->deleted)
495 continue; 492 continue;
496 493