diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-12 02:09:30 +0200 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-20 22:15:19 +0200 |
commit | 84d5e5e003752bc56b413f8d2c3fcfeeec066145 (patch) | |
tree | fcba8ac1059d844f5a8e98caaa0ed50cd499d91f /net/batman-adv/gateway_client.c | |
parent | 7cf06bc6ff810178a7fb9f12aaa6b274fc520f6f (diff) | |
download | talos-obmc-linux-84d5e5e003752bc56b413f8d2c3fcfeeec066145.tar.gz talos-obmc-linux-84d5e5e003752bc56b413f8d2c3fcfeeec066145.zip |
batman-adv: Prefix gateway-common non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/gateway_client.c')
-rw-r--r-- | net/batman-adv/gateway_client.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index a28d9ce86812..a3f944b6ac53 100644 --- a/net/batman-adv/gateway_client.c +++ b/net/batman-adv/gateway_client.c @@ -116,13 +116,15 @@ static struct gw_node *gw_get_best_gw_node(struct bat_priv *bat_priv) uint32_t max_gw_factor = 0, tmp_gw_factor = 0; uint8_t max_tq = 0; int down, up; + struct orig_node *orig_node; rcu_read_lock(); hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw_list, list) { if (gw_node->deleted) continue; - router = orig_node_get_router(gw_node->orig_node); + orig_node = gw_node->orig_node; + router = orig_node_get_router(orig_node); if (!router) continue; @@ -131,8 +133,8 @@ static struct gw_node *gw_get_best_gw_node(struct bat_priv *bat_priv) switch (atomic_read(&bat_priv->gw_sel_class)) { case 1: /* fast connection */ - gw_bandwidth_to_kbit(gw_node->orig_node->gw_flags, - &down, &up); + batadv_gw_bandwidth_to_kbit(orig_node->gw_flags, + &down, &up); tmp_gw_factor = (router->tq_avg * router->tq_avg * down * 100 * 100) / @@ -319,7 +321,7 @@ static void gw_node_add(struct bat_priv *bat_priv, hlist_add_head_rcu(&gw_node->list, &bat_priv->gw_list); spin_unlock_bh(&bat_priv->gw_list_lock); - gw_bandwidth_to_kbit(new_gwflags, &down, &up); + batadv_gw_bandwidth_to_kbit(new_gwflags, &down, &up); bat_dbg(DBG_BATMAN, bat_priv, "Found new gateway %pM -> gw_class: %i - %i%s/%i%s\n", orig_node->orig, new_gwflags, @@ -434,7 +436,7 @@ static int _write_buffer_text(struct bat_priv *bat_priv, struct seq_file *seq, struct neigh_node *router; int down, up, ret = -1; - gw_bandwidth_to_kbit(gw_node->orig_node->gw_flags, &down, &up); + batadv_gw_bandwidth_to_kbit(gw_node->orig_node->gw_flags, &down, &up); router = orig_node_get_router(gw_node->orig_node); if (!router) |