diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-11 20:09:29 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-20 16:15:18 -0400 |
commit | 7cf06bc6ff810178a7fb9f12aaa6b274fc520f6f (patch) | |
tree | d2155e204af6153174f9a7f37596c21e04c65ddb /net/batman-adv/gateway_client.c | |
parent | 08adf1512298201a53b88bb0a3d67e0dbbe0ed9b (diff) |
batman-adv: Prefix gateway-client 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 | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index 1d7f08e026f3..a28d9ce86812 100644 --- a/net/batman-adv/gateway_client.c +++ b/net/batman-adv/gateway_client.c | |||
@@ -60,7 +60,7 @@ out: | |||
60 | return gw_node; | 60 | return gw_node; |
61 | } | 61 | } |
62 | 62 | ||
63 | struct orig_node *gw_get_selected_orig(struct bat_priv *bat_priv) | 63 | struct orig_node *batadv_gw_get_selected_orig(struct bat_priv *bat_priv) |
64 | { | 64 | { |
65 | struct gw_node *gw_node; | 65 | struct gw_node *gw_node; |
66 | struct orig_node *orig_node = NULL; | 66 | struct orig_node *orig_node = NULL; |
@@ -103,7 +103,7 @@ static void gw_select(struct bat_priv *bat_priv, struct gw_node *new_gw_node) | |||
103 | spin_unlock_bh(&bat_priv->gw_list_lock); | 103 | spin_unlock_bh(&bat_priv->gw_list_lock); |
104 | } | 104 | } |
105 | 105 | ||
106 | void gw_deselect(struct bat_priv *bat_priv) | 106 | void batadv_gw_deselect(struct bat_priv *bat_priv) |
107 | { | 107 | { |
108 | atomic_set(&bat_priv->gw_reselect, 1); | 108 | atomic_set(&bat_priv->gw_reselect, 1); |
109 | } | 109 | } |
@@ -182,7 +182,7 @@ next: | |||
182 | return curr_gw; | 182 | return curr_gw; |
183 | } | 183 | } |
184 | 184 | ||
185 | void gw_election(struct bat_priv *bat_priv) | 185 | void batadv_gw_election(struct bat_priv *bat_priv) |
186 | { | 186 | { |
187 | struct gw_node *curr_gw = NULL, *next_gw = NULL; | 187 | struct gw_node *curr_gw = NULL, *next_gw = NULL; |
188 | struct neigh_node *router = NULL; | 188 | struct neigh_node *router = NULL; |
@@ -212,7 +212,7 @@ void gw_election(struct bat_priv *bat_priv) | |||
212 | 212 | ||
213 | router = orig_node_get_router(next_gw->orig_node); | 213 | router = orig_node_get_router(next_gw->orig_node); |
214 | if (!router) { | 214 | if (!router) { |
215 | gw_deselect(bat_priv); | 215 | batadv_gw_deselect(bat_priv); |
216 | goto out; | 216 | goto out; |
217 | } | 217 | } |
218 | } | 218 | } |
@@ -246,13 +246,14 @@ out: | |||
246 | neigh_node_free_ref(router); | 246 | neigh_node_free_ref(router); |
247 | } | 247 | } |
248 | 248 | ||
249 | void gw_check_election(struct bat_priv *bat_priv, struct orig_node *orig_node) | 249 | void batadv_gw_check_election(struct bat_priv *bat_priv, |
250 | struct orig_node *orig_node) | ||
250 | { | 251 | { |
251 | struct orig_node *curr_gw_orig; | 252 | struct orig_node *curr_gw_orig; |
252 | struct neigh_node *router_gw = NULL, *router_orig = NULL; | 253 | struct neigh_node *router_gw = NULL, *router_orig = NULL; |
253 | uint8_t gw_tq_avg, orig_tq_avg; | 254 | uint8_t gw_tq_avg, orig_tq_avg; |
254 | 255 | ||
255 | curr_gw_orig = gw_get_selected_orig(bat_priv); | 256 | curr_gw_orig = batadv_gw_get_selected_orig(bat_priv); |
256 | if (!curr_gw_orig) | 257 | if (!curr_gw_orig) |
257 | goto deselect; | 258 | goto deselect; |
258 | 259 | ||
@@ -288,7 +289,7 @@ void gw_check_election(struct bat_priv *bat_priv, struct orig_node *orig_node) | |||
288 | gw_tq_avg, orig_tq_avg); | 289 | gw_tq_avg, orig_tq_avg); |
289 | 290 | ||
290 | deselect: | 291 | deselect: |
291 | gw_deselect(bat_priv); | 292 | batadv_gw_deselect(bat_priv); |
292 | out: | 293 | out: |
293 | if (curr_gw_orig) | 294 | if (curr_gw_orig) |
294 | orig_node_free_ref(curr_gw_orig); | 295 | orig_node_free_ref(curr_gw_orig); |
@@ -328,8 +329,8 @@ static void gw_node_add(struct bat_priv *bat_priv, | |||
328 | (up > 2048 ? "MBit" : "KBit")); | 329 | (up > 2048 ? "MBit" : "KBit")); |
329 | } | 330 | } |
330 | 331 | ||
331 | void gw_node_update(struct bat_priv *bat_priv, | 332 | void batadv_gw_node_update(struct bat_priv *bat_priv, |
332 | struct orig_node *orig_node, uint8_t new_gwflags) | 333 | struct orig_node *orig_node, uint8_t new_gwflags) |
333 | { | 334 | { |
334 | struct hlist_node *node; | 335 | struct hlist_node *node; |
335 | struct gw_node *gw_node, *curr_gw; | 336 | struct gw_node *gw_node, *curr_gw; |
@@ -374,7 +375,7 @@ void gw_node_update(struct bat_priv *bat_priv, | |||
374 | goto unlock; | 375 | goto unlock; |
375 | 376 | ||
376 | deselect: | 377 | deselect: |
377 | gw_deselect(bat_priv); | 378 | batadv_gw_deselect(bat_priv); |
378 | unlock: | 379 | unlock: |
379 | rcu_read_unlock(); | 380 | rcu_read_unlock(); |
380 | 381 | ||
@@ -382,12 +383,13 @@ unlock: | |||
382 | gw_node_free_ref(curr_gw); | 383 | gw_node_free_ref(curr_gw); |
383 | } | 384 | } |
384 | 385 | ||
385 | void gw_node_delete(struct bat_priv *bat_priv, struct orig_node *orig_node) | 386 | void batadv_gw_node_delete(struct bat_priv *bat_priv, |
387 | struct orig_node *orig_node) | ||
386 | { | 388 | { |
387 | gw_node_update(bat_priv, orig_node, 0); | 389 | batadv_gw_node_update(bat_priv, orig_node, 0); |
388 | } | 390 | } |
389 | 391 | ||
390 | void gw_node_purge(struct bat_priv *bat_priv) | 392 | void batadv_gw_node_purge(struct bat_priv *bat_priv) |
391 | { | 393 | { |
392 | struct gw_node *gw_node, *curr_gw; | 394 | struct gw_node *gw_node, *curr_gw; |
393 | struct hlist_node *node, *node_tmp; | 395 | struct hlist_node *node, *node_tmp; |
@@ -416,7 +418,7 @@ void gw_node_purge(struct bat_priv *bat_priv) | |||
416 | 418 | ||
417 | /* gw_deselect() needs to acquire the gw_list_lock */ | 419 | /* gw_deselect() needs to acquire the gw_list_lock */ |
418 | if (do_deselect) | 420 | if (do_deselect) |
419 | gw_deselect(bat_priv); | 421 | batadv_gw_deselect(bat_priv); |
420 | 422 | ||
421 | if (curr_gw) | 423 | if (curr_gw) |
422 | gw_node_free_ref(curr_gw); | 424 | gw_node_free_ref(curr_gw); |
@@ -458,7 +460,7 @@ out: | |||
458 | return ret; | 460 | return ret; |
459 | } | 461 | } |
460 | 462 | ||
461 | int gw_client_seq_print_text(struct seq_file *seq, void *offset) | 463 | int batadv_gw_client_seq_print_text(struct seq_file *seq, void *offset) |
462 | { | 464 | { |
463 | struct net_device *net_dev = (struct net_device *)seq->private; | 465 | struct net_device *net_dev = (struct net_device *)seq->private; |
464 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 466 | struct bat_priv *bat_priv = netdev_priv(net_dev); |
@@ -568,7 +570,7 @@ out: | |||
568 | return ret; | 570 | return ret; |
569 | } | 571 | } |
570 | 572 | ||
571 | bool gw_is_dhcp_target(struct sk_buff *skb, unsigned int *header_len) | 573 | bool batadv_gw_is_dhcp_target(struct sk_buff *skb, unsigned int *header_len) |
572 | { | 574 | { |
573 | struct ethhdr *ethhdr; | 575 | struct ethhdr *ethhdr; |
574 | struct iphdr *iphdr; | 576 | struct iphdr *iphdr; |
@@ -634,8 +636,8 @@ bool gw_is_dhcp_target(struct sk_buff *skb, unsigned int *header_len) | |||
634 | return true; | 636 | return true; |
635 | } | 637 | } |
636 | 638 | ||
637 | bool gw_out_of_range(struct bat_priv *bat_priv, | 639 | bool batadv_gw_out_of_range(struct bat_priv *bat_priv, |
638 | struct sk_buff *skb, struct ethhdr *ethhdr) | 640 | struct sk_buff *skb, struct ethhdr *ethhdr) |
639 | { | 641 | { |
640 | struct neigh_node *neigh_curr = NULL, *neigh_old = NULL; | 642 | struct neigh_node *neigh_curr = NULL, *neigh_old = NULL; |
641 | struct orig_node *orig_dst_node = NULL; | 643 | struct orig_node *orig_dst_node = NULL; |
@@ -644,7 +646,7 @@ bool gw_out_of_range(struct bat_priv *bat_priv, | |||
644 | unsigned int header_len = 0; | 646 | unsigned int header_len = 0; |
645 | uint8_t curr_tq_avg; | 647 | uint8_t curr_tq_avg; |
646 | 648 | ||
647 | ret = gw_is_dhcp_target(skb, &header_len); | 649 | ret = batadv_gw_is_dhcp_target(skb, &header_len); |
648 | if (!ret) | 650 | if (!ret) |
649 | goto out; | 651 | goto out; |
650 | 652 | ||