aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-11 20:09:40 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-20 16:15:30 -0400
commit88ed1e7772bbedfd0bb013c209f61619eca0a781 (patch)
treea3a47bbec633ca411ba06cb0ab5177740ec5f387 /net/batman-adv
parent08c36d3e8ad1f73d3b0322842363b23f6d203630 (diff)
batman-adv: Prefix unicast 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')
-rw-r--r--net/batman-adv/originator.c4
-rw-r--r--net/batman-adv/routing.c9
-rw-r--r--net/batman-adv/soft-interface.c2
-rw-r--r--net/batman-adv/unicast.c19
-rw-r--r--net/batman-adv/unicast.h13
5 files changed, 25 insertions, 22 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 030666c12daf..9d77edeff589 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -138,7 +138,7 @@ static void orig_node_free_rcu(struct rcu_head *rcu)
138 138
139 spin_unlock_bh(&orig_node->neigh_list_lock); 139 spin_unlock_bh(&orig_node->neigh_list_lock);
140 140
141 frag_list_free(&orig_node->frag_list); 141 batadv_frag_list_free(&orig_node->frag_list);
142 batadv_tt_global_del_orig(orig_node->bat_priv, orig_node, 142 batadv_tt_global_del_orig(orig_node->bat_priv, orig_node,
143 "originator timed out"); 143 "originator timed out");
144 144
@@ -372,7 +372,7 @@ static void _purge_orig(struct bat_priv *bat_priv)
372 372
373 if (has_timed_out(orig_node->last_frag_packet, 373 if (has_timed_out(orig_node->last_frag_packet,
374 FRAG_TIMEOUT)) 374 FRAG_TIMEOUT))
375 frag_list_free(&orig_node->frag_list); 375 batadv_frag_list_free(&orig_node->frag_list);
376 } 376 }
377 spin_unlock_bh(list_lock); 377 spin_unlock_bh(list_lock);
378 } 378 }
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 8fb5ae3dee87..4103f68ae9db 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -850,15 +850,16 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
850 if (unicast_packet->header.packet_type == BAT_UNICAST && 850 if (unicast_packet->header.packet_type == BAT_UNICAST &&
851 atomic_read(&bat_priv->fragmentation) && 851 atomic_read(&bat_priv->fragmentation) &&
852 skb->len > neigh_node->if_incoming->net_dev->mtu) { 852 skb->len > neigh_node->if_incoming->net_dev->mtu) {
853 ret = frag_send_skb(skb, bat_priv, 853 ret = batadv_frag_send_skb(skb, bat_priv,
854 neigh_node->if_incoming, neigh_node->addr); 854 neigh_node->if_incoming,
855 neigh_node->addr);
855 goto out; 856 goto out;
856 } 857 }
857 858
858 if (unicast_packet->header.packet_type == BAT_UNICAST_FRAG && 859 if (unicast_packet->header.packet_type == BAT_UNICAST_FRAG &&
859 frag_can_reassemble(skb, neigh_node->if_incoming->net_dev->mtu)) { 860 frag_can_reassemble(skb, neigh_node->if_incoming->net_dev->mtu)) {
860 861
861 ret = frag_reassemble_skb(skb, bat_priv, &new_skb); 862 ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb);
862 863
863 if (ret == NET_RX_DROP) 864 if (ret == NET_RX_DROP)
864 goto out; 865 goto out;
@@ -1013,7 +1014,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
1013 /* packet for me */ 1014 /* packet for me */
1014 if (is_my_mac(unicast_packet->dest)) { 1015 if (is_my_mac(unicast_packet->dest)) {
1015 1016
1016 ret = frag_reassemble_skb(skb, bat_priv, &new_skb); 1017 ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb);
1017 1018
1018 if (ret == NET_RX_DROP) 1019 if (ret == NET_RX_DROP)
1019 return NET_RX_DROP; 1020 return NET_RX_DROP;
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index a4b5e64bf0c7..9fd1925775c7 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -237,7 +237,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
237 goto dropped; 237 goto dropped;
238 } 238 }
239 239
240 ret = unicast_send_skb(skb, bat_priv); 240 ret = batadv_unicast_send_skb(skb, bat_priv);
241 if (ret != 0) 241 if (ret != 0)
242 goto dropped_freed; 242 goto dropped_freed;
243 } 243 }
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
index 5e699db700b3..e9d3bdd4e3d6 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
@@ -101,7 +101,7 @@ static int frag_create_buffer(struct list_head *head)
101 for (i = 0; i < FRAG_BUFFER_SIZE; i++) { 101 for (i = 0; i < FRAG_BUFFER_SIZE; i++) {
102 tfp = kmalloc(sizeof(*tfp), GFP_ATOMIC); 102 tfp = kmalloc(sizeof(*tfp), GFP_ATOMIC);
103 if (!tfp) { 103 if (!tfp) {
104 frag_list_free(head); 104 batadv_frag_list_free(head);
105 return -ENOMEM; 105 return -ENOMEM;
106 } 106 }
107 tfp->skb = NULL; 107 tfp->skb = NULL;
@@ -151,7 +151,7 @@ mov_tail:
151 return NULL; 151 return NULL;
152} 152}
153 153
154void frag_list_free(struct list_head *head) 154void batadv_frag_list_free(struct list_head *head)
155{ 155{
156 struct frag_packet_list_entry *pf, *tmp_pf; 156 struct frag_packet_list_entry *pf, *tmp_pf;
157 157
@@ -172,8 +172,8 @@ void frag_list_free(struct list_head *head)
172 * or the skb could be reassembled (skb_new will point to the new packet and 172 * or the skb could be reassembled (skb_new will point to the new packet and
173 * skb was freed) 173 * skb was freed)
174 */ 174 */
175int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, 175int batadv_frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
176 struct sk_buff **new_skb) 176 struct sk_buff **new_skb)
177{ 177{
178 struct orig_node *orig_node; 178 struct orig_node *orig_node;
179 struct frag_packet_list_entry *tmp_frag_entry; 179 struct frag_packet_list_entry *tmp_frag_entry;
@@ -216,8 +216,8 @@ out:
216 return ret; 216 return ret;
217} 217}
218 218
219int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, 219int batadv_frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
220 struct hard_iface *hard_iface, const uint8_t dstaddr[]) 220 struct hard_iface *hard_iface, const uint8_t dstaddr[])
221{ 221{
222 struct unicast_packet tmp_uc, *unicast_packet; 222 struct unicast_packet tmp_uc, *unicast_packet;
223 struct hard_iface *primary_if; 223 struct hard_iface *primary_if;
@@ -283,7 +283,7 @@ out:
283 return ret; 283 return ret;
284} 284}
285 285
286int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv) 286int batadv_unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv)
287{ 287{
288 struct ethhdr *ethhdr = (struct ethhdr *)skb->data; 288 struct ethhdr *ethhdr = (struct ethhdr *)skb->data;
289 struct unicast_packet *unicast_packet; 289 struct unicast_packet *unicast_packet;
@@ -342,8 +342,9 @@ find_router:
342 neigh_node->if_incoming->net_dev->mtu) { 342 neigh_node->if_incoming->net_dev->mtu) {
343 /* send frag skb decreases ttl */ 343 /* send frag skb decreases ttl */
344 unicast_packet->header.ttl++; 344 unicast_packet->header.ttl++;
345 ret = frag_send_skb(skb, bat_priv, 345 ret = batadv_frag_send_skb(skb, bat_priv,
346 neigh_node->if_incoming, neigh_node->addr); 346 neigh_node->if_incoming,
347 neigh_node->addr);
347 goto out; 348 goto out;
348 } 349 }
349 350
diff --git a/net/batman-adv/unicast.h b/net/batman-adv/unicast.h
index a9faf6b1db19..657fe7392b14 100644
--- a/net/batman-adv/unicast.h
+++ b/net/batman-adv/unicast.h
@@ -27,12 +27,13 @@
27#define FRAG_TIMEOUT 10000 /* purge frag list entries after time in ms */ 27#define FRAG_TIMEOUT 10000 /* purge frag list entries after time in ms */
28#define FRAG_BUFFER_SIZE 6 /* number of list elements in buffer */ 28#define FRAG_BUFFER_SIZE 6 /* number of list elements in buffer */
29 29
30int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, 30int batadv_frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
31 struct sk_buff **new_skb); 31 struct sk_buff **new_skb);
32void frag_list_free(struct list_head *head); 32void batadv_frag_list_free(struct list_head *head);
33int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv); 33int batadv_unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv);
34int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, 34int batadv_frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
35 struct hard_iface *hard_iface, const uint8_t dstaddr[]); 35 struct hard_iface *hard_iface,
36 const uint8_t dstaddr[]);
36 37
37static inline int frag_can_reassemble(const struct sk_buff *skb, int mtu) 38static inline int frag_can_reassemble(const struct sk_buff *skb, int mtu)
38{ 39{