diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-11 20:09:34 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-20 16:15:23 -0400 |
commit | 7d211efc5087bc8870fa3374da88b4bf8159e79b (patch) | |
tree | 1cd6c7b6543610f7e684ac20988735c7c6d1c8fa /net/batman-adv/routing.c | |
parent | 9039dc7e8a42864744665bf0905f48c2724f6e3e (diff) |
batman-adv: Prefix originator 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/routing.c')
-rw-r--r-- | net/batman-adv/routing.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 7525e4fd2faf..77fe46065db6 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -69,7 +69,7 @@ static void _update_route(struct bat_priv *bat_priv, | |||
69 | { | 69 | { |
70 | struct neigh_node *curr_router; | 70 | struct neigh_node *curr_router; |
71 | 71 | ||
72 | curr_router = orig_node_get_router(orig_node); | 72 | curr_router = batadv_orig_node_get_router(orig_node); |
73 | 73 | ||
74 | /* route deleted */ | 74 | /* route deleted */ |
75 | if ((curr_router) && (!neigh_node)) { | 75 | if ((curr_router) && (!neigh_node)) { |
@@ -93,7 +93,7 @@ static void _update_route(struct bat_priv *bat_priv, | |||
93 | } | 93 | } |
94 | 94 | ||
95 | if (curr_router) | 95 | if (curr_router) |
96 | neigh_node_free_ref(curr_router); | 96 | batadv_neigh_node_free_ref(curr_router); |
97 | 97 | ||
98 | /* increase refcount of new best neighbor */ | 98 | /* increase refcount of new best neighbor */ |
99 | if (neigh_node && !atomic_inc_not_zero(&neigh_node->refcount)) | 99 | if (neigh_node && !atomic_inc_not_zero(&neigh_node->refcount)) |
@@ -105,7 +105,7 @@ static void _update_route(struct bat_priv *bat_priv, | |||
105 | 105 | ||
106 | /* decrease refcount of previous best neighbor */ | 106 | /* decrease refcount of previous best neighbor */ |
107 | if (curr_router) | 107 | if (curr_router) |
108 | neigh_node_free_ref(curr_router); | 108 | batadv_neigh_node_free_ref(curr_router); |
109 | } | 109 | } |
110 | 110 | ||
111 | void update_route(struct bat_priv *bat_priv, struct orig_node *orig_node, | 111 | void update_route(struct bat_priv *bat_priv, struct orig_node *orig_node, |
@@ -116,14 +116,14 @@ void update_route(struct bat_priv *bat_priv, struct orig_node *orig_node, | |||
116 | if (!orig_node) | 116 | if (!orig_node) |
117 | goto out; | 117 | goto out; |
118 | 118 | ||
119 | router = orig_node_get_router(orig_node); | 119 | router = batadv_orig_node_get_router(orig_node); |
120 | 120 | ||
121 | if (router != neigh_node) | 121 | if (router != neigh_node) |
122 | _update_route(bat_priv, orig_node, neigh_node); | 122 | _update_route(bat_priv, orig_node, neigh_node); |
123 | 123 | ||
124 | out: | 124 | out: |
125 | if (router) | 125 | if (router) |
126 | neigh_node_free_ref(router); | 126 | batadv_neigh_node_free_ref(router); |
127 | } | 127 | } |
128 | 128 | ||
129 | /* caller must hold the neigh_list_lock */ | 129 | /* caller must hold the neigh_list_lock */ |
@@ -136,7 +136,7 @@ void bonding_candidate_del(struct orig_node *orig_node, | |||
136 | 136 | ||
137 | list_del_rcu(&neigh_node->bonding_list); | 137 | list_del_rcu(&neigh_node->bonding_list); |
138 | INIT_LIST_HEAD(&neigh_node->bonding_list); | 138 | INIT_LIST_HEAD(&neigh_node->bonding_list); |
139 | neigh_node_free_ref(neigh_node); | 139 | batadv_neigh_node_free_ref(neigh_node); |
140 | atomic_dec(&orig_node->bond_candidates); | 140 | atomic_dec(&orig_node->bond_candidates); |
141 | 141 | ||
142 | out: | 142 | out: |
@@ -157,7 +157,7 @@ void bonding_candidate_add(struct orig_node *orig_node, | |||
157 | neigh_node->orig_node->primary_addr)) | 157 | neigh_node->orig_node->primary_addr)) |
158 | goto candidate_del; | 158 | goto candidate_del; |
159 | 159 | ||
160 | router = orig_node_get_router(orig_node); | 160 | router = batadv_orig_node_get_router(orig_node); |
161 | if (!router) | 161 | if (!router) |
162 | goto candidate_del; | 162 | goto candidate_del; |
163 | 163 | ||
@@ -210,7 +210,7 @@ out: | |||
210 | spin_unlock_bh(&orig_node->neigh_list_lock); | 210 | spin_unlock_bh(&orig_node->neigh_list_lock); |
211 | 211 | ||
212 | if (router) | 212 | if (router) |
213 | neigh_node_free_ref(router); | 213 | batadv_neigh_node_free_ref(router); |
214 | } | 214 | } |
215 | 215 | ||
216 | /* copy primary address for bonding */ | 216 | /* copy primary address for bonding */ |
@@ -303,7 +303,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv, | |||
303 | if (!orig_node) | 303 | if (!orig_node) |
304 | goto out; | 304 | goto out; |
305 | 305 | ||
306 | router = orig_node_get_router(orig_node); | 306 | router = batadv_orig_node_get_router(orig_node); |
307 | if (!router) | 307 | if (!router) |
308 | goto out; | 308 | goto out; |
309 | 309 | ||
@@ -325,9 +325,9 @@ out: | |||
325 | if (primary_if) | 325 | if (primary_if) |
326 | hardif_free_ref(primary_if); | 326 | hardif_free_ref(primary_if); |
327 | if (router) | 327 | if (router) |
328 | neigh_node_free_ref(router); | 328 | batadv_neigh_node_free_ref(router); |
329 | if (orig_node) | 329 | if (orig_node) |
330 | orig_node_free_ref(orig_node); | 330 | batadv_orig_node_free_ref(orig_node); |
331 | return ret; | 331 | return ret; |
332 | } | 332 | } |
333 | 333 | ||
@@ -358,7 +358,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv, | |||
358 | if (!orig_node) | 358 | if (!orig_node) |
359 | goto out; | 359 | goto out; |
360 | 360 | ||
361 | router = orig_node_get_router(orig_node); | 361 | router = batadv_orig_node_get_router(orig_node); |
362 | if (!router) | 362 | if (!router) |
363 | goto out; | 363 | goto out; |
364 | 364 | ||
@@ -380,9 +380,9 @@ out: | |||
380 | if (primary_if) | 380 | if (primary_if) |
381 | hardif_free_ref(primary_if); | 381 | hardif_free_ref(primary_if); |
382 | if (router) | 382 | if (router) |
383 | neigh_node_free_ref(router); | 383 | batadv_neigh_node_free_ref(router); |
384 | if (orig_node) | 384 | if (orig_node) |
385 | orig_node_free_ref(orig_node); | 385 | batadv_orig_node_free_ref(orig_node); |
386 | return ret; | 386 | return ret; |
387 | } | 387 | } |
388 | 388 | ||
@@ -444,7 +444,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
444 | if (!orig_node) | 444 | if (!orig_node) |
445 | goto out; | 445 | goto out; |
446 | 446 | ||
447 | router = orig_node_get_router(orig_node); | 447 | router = batadv_orig_node_get_router(orig_node); |
448 | if (!router) | 448 | if (!router) |
449 | goto out; | 449 | goto out; |
450 | 450 | ||
@@ -463,9 +463,9 @@ int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
463 | 463 | ||
464 | out: | 464 | out: |
465 | if (router) | 465 | if (router) |
466 | neigh_node_free_ref(router); | 466 | batadv_neigh_node_free_ref(router); |
467 | if (orig_node) | 467 | if (orig_node) |
468 | orig_node_free_ref(orig_node); | 468 | batadv_orig_node_free_ref(orig_node); |
469 | return ret; | 469 | return ret; |
470 | } | 470 | } |
471 | 471 | ||
@@ -551,13 +551,13 @@ static struct neigh_node *find_ifalter_router(struct orig_node *primary_orig, | |||
551 | /* decrement refcount of | 551 | /* decrement refcount of |
552 | * previously selected router */ | 552 | * previously selected router */ |
553 | if (router) | 553 | if (router) |
554 | neigh_node_free_ref(router); | 554 | batadv_neigh_node_free_ref(router); |
555 | 555 | ||
556 | router = tmp_neigh_node; | 556 | router = tmp_neigh_node; |
557 | atomic_inc_not_zero(&router->refcount); | 557 | atomic_inc_not_zero(&router->refcount); |
558 | } | 558 | } |
559 | 559 | ||
560 | neigh_node_free_ref(tmp_neigh_node); | 560 | batadv_neigh_node_free_ref(tmp_neigh_node); |
561 | } | 561 | } |
562 | 562 | ||
563 | /* use the first candidate if nothing was found. */ | 563 | /* use the first candidate if nothing was found. */ |
@@ -695,7 +695,7 @@ int recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if) | |||
695 | * packets for the correct destination. */ | 695 | * packets for the correct destination. */ |
696 | bat_priv->tt_poss_change = true; | 696 | bat_priv->tt_poss_change = true; |
697 | 697 | ||
698 | orig_node_free_ref(orig_node); | 698 | batadv_orig_node_free_ref(orig_node); |
699 | out: | 699 | out: |
700 | /* returning NET_RX_DROP will make the caller function kfree the skb */ | 700 | /* returning NET_RX_DROP will make the caller function kfree the skb */ |
701 | return NET_RX_DROP; | 701 | return NET_RX_DROP; |
@@ -717,7 +717,7 @@ struct neigh_node *find_router(struct bat_priv *bat_priv, | |||
717 | if (!orig_node) | 717 | if (!orig_node) |
718 | return NULL; | 718 | return NULL; |
719 | 719 | ||
720 | router = orig_node_get_router(orig_node); | 720 | router = batadv_orig_node_get_router(orig_node); |
721 | if (!router) | 721 | if (!router) |
722 | goto err; | 722 | goto err; |
723 | 723 | ||
@@ -750,7 +750,7 @@ struct neigh_node *find_router(struct bat_priv *bat_priv, | |||
750 | if (!primary_orig_node) | 750 | if (!primary_orig_node) |
751 | goto return_router; | 751 | goto return_router; |
752 | 752 | ||
753 | orig_node_free_ref(primary_orig_node); | 753 | batadv_orig_node_free_ref(primary_orig_node); |
754 | } | 754 | } |
755 | 755 | ||
756 | /* with less than 2 candidates, we can't do any | 756 | /* with less than 2 candidates, we can't do any |
@@ -762,7 +762,7 @@ struct neigh_node *find_router(struct bat_priv *bat_priv, | |||
762 | * is is not on the interface where the packet came | 762 | * is is not on the interface where the packet came |
763 | * in. */ | 763 | * in. */ |
764 | 764 | ||
765 | neigh_node_free_ref(router); | 765 | batadv_neigh_node_free_ref(router); |
766 | 766 | ||
767 | if (bonding_enabled) | 767 | if (bonding_enabled) |
768 | router = find_bond_router(primary_orig_node, recv_if); | 768 | router = find_bond_router(primary_orig_node, recv_if); |
@@ -779,7 +779,7 @@ err_unlock: | |||
779 | rcu_read_unlock(); | 779 | rcu_read_unlock(); |
780 | err: | 780 | err: |
781 | if (router) | 781 | if (router) |
782 | neigh_node_free_ref(router); | 782 | batadv_neigh_node_free_ref(router); |
783 | return NULL; | 783 | return NULL; |
784 | } | 784 | } |
785 | 785 | ||
@@ -885,9 +885,9 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
885 | 885 | ||
886 | out: | 886 | out: |
887 | if (neigh_node) | 887 | if (neigh_node) |
888 | neigh_node_free_ref(neigh_node); | 888 | batadv_neigh_node_free_ref(neigh_node); |
889 | if (orig_node) | 889 | if (orig_node) |
890 | orig_node_free_ref(orig_node); | 890 | batadv_orig_node_free_ref(orig_node); |
891 | return ret; | 891 | return ret; |
892 | } | 892 | } |
893 | 893 | ||
@@ -917,7 +917,7 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv, | |||
917 | 917 | ||
918 | curr_ttvn = (uint8_t)atomic_read(&orig_node->last_ttvn); | 918 | curr_ttvn = (uint8_t)atomic_read(&orig_node->last_ttvn); |
919 | tt_poss_change = orig_node->tt_poss_change; | 919 | tt_poss_change = orig_node->tt_poss_change; |
920 | orig_node_free_ref(orig_node); | 920 | batadv_orig_node_free_ref(orig_node); |
921 | } | 921 | } |
922 | 922 | ||
923 | /* Check whether I have to reroute the packet */ | 923 | /* Check whether I have to reroute the packet */ |
@@ -952,7 +952,7 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv, | |||
952 | ETH_ALEN); | 952 | ETH_ALEN); |
953 | curr_ttvn = (uint8_t) | 953 | curr_ttvn = (uint8_t) |
954 | atomic_read(&orig_node->last_ttvn); | 954 | atomic_read(&orig_node->last_ttvn); |
955 | orig_node_free_ref(orig_node); | 955 | batadv_orig_node_free_ref(orig_node); |
956 | } | 956 | } |
957 | 957 | ||
958 | bat_dbg(DBG_ROUTES, bat_priv, | 958 | bat_dbg(DBG_ROUTES, bat_priv, |
@@ -1110,7 +1110,7 @@ spin_unlock: | |||
1110 | spin_unlock_bh(&orig_node->bcast_seqno_lock); | 1110 | spin_unlock_bh(&orig_node->bcast_seqno_lock); |
1111 | out: | 1111 | out: |
1112 | if (orig_node) | 1112 | if (orig_node) |
1113 | orig_node_free_ref(orig_node); | 1113 | batadv_orig_node_free_ref(orig_node); |
1114 | return ret; | 1114 | return ret; |
1115 | } | 1115 | } |
1116 | 1116 | ||