aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-11 20:09:38 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-20 16:15:28 -0400
commit04b482a21aaf22cf5b327fb6a3fba6fdc8cb3de9 (patch)
tree4035e2c89d47a961045c01d98d7bb4588478b86a /net
parent9455e34cb2ded22e01abb6daa65ba1caeed8d7fe (diff)
batman-adv: Prefix soft-interface 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')
-rw-r--r--net/batman-adv/hard-interface.c8
-rw-r--r--net/batman-adv/routing.c9
-rw-r--r--net/batman-adv/send.c2
-rw-r--r--net/batman-adv/soft-interface.c16
-rw-r--r--net/batman-adv/soft-interface.h13
-rw-r--r--net/batman-adv/unicast.c6
6 files changed, 27 insertions, 27 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 7392ae28114d..93acf2be7759 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -71,7 +71,7 @@ static int is_valid_iface(const struct net_device *net_dev)
71 return 0; 71 return 0;
72 72
73 /* no batman over batman */ 73 /* no batman over batman */
74 if (softif_is_valid(net_dev)) 74 if (batadv_softif_is_valid(net_dev))
75 return 0; 75 return 0;
76 76
77 /* Device is being bridged */ 77 /* Device is being bridged */
@@ -284,7 +284,7 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
284 soft_iface = dev_get_by_name(&init_net, iface_name); 284 soft_iface = dev_get_by_name(&init_net, iface_name);
285 285
286 if (!soft_iface) { 286 if (!soft_iface) {
287 soft_iface = softif_create(iface_name); 287 soft_iface = batadv_softif_create(iface_name);
288 288
289 if (!soft_iface) { 289 if (!soft_iface) {
290 ret = -ENOMEM; 290 ret = -ENOMEM;
@@ -295,7 +295,7 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
295 dev_hold(soft_iface); 295 dev_hold(soft_iface);
296 } 296 }
297 297
298 if (!softif_is_valid(soft_iface)) { 298 if (!batadv_softif_is_valid(soft_iface)) {
299 pr_err("Can't create batman mesh interface %s: already exists as regular interface\n", 299 pr_err("Can't create batman mesh interface %s: already exists as regular interface\n",
300 soft_iface->name); 300 soft_iface->name);
301 ret = -EINVAL; 301 ret = -EINVAL;
@@ -396,7 +396,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
396 396
397 /* nobody uses this interface anymore */ 397 /* nobody uses this interface anymore */
398 if (!bat_priv->num_ifaces) 398 if (!bat_priv->num_ifaces)
399 softif_destroy(hard_iface->soft_iface); 399 batadv_softif_destroy(hard_iface->soft_iface);
400 400
401 hard_iface->soft_iface = NULL; 401 hard_iface->soft_iface = NULL;
402 hardif_free_ref(hard_iface); 402 hardif_free_ref(hard_iface);
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index d7d05b22cc0d..0e982218e630 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -982,7 +982,8 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
982 982
983 /* packet for me */ 983 /* packet for me */
984 if (is_my_mac(unicast_packet->dest)) { 984 if (is_my_mac(unicast_packet->dest)) {
985 interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size); 985 batadv_interface_rx(recv_if->soft_iface, skb, recv_if,
986 hdr_size);
986 return NET_RX_SUCCESS; 987 return NET_RX_SUCCESS;
987 } 988 }
988 989
@@ -1018,8 +1019,8 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
1018 if (!new_skb) 1019 if (!new_skb)
1019 return NET_RX_SUCCESS; 1020 return NET_RX_SUCCESS;
1020 1021
1021 interface_rx(recv_if->soft_iface, new_skb, recv_if, 1022 batadv_interface_rx(recv_if->soft_iface, new_skb, recv_if,
1022 sizeof(struct unicast_packet)); 1023 sizeof(struct unicast_packet));
1023 return NET_RX_SUCCESS; 1024 return NET_RX_SUCCESS;
1024 } 1025 }
1025 1026
@@ -1104,7 +1105,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
1104 goto out; 1105 goto out;
1105 1106
1106 /* broadcast for me */ 1107 /* broadcast for me */
1107 interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size); 1108 batadv_interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size);
1108 ret = NET_RX_SUCCESS; 1109 ret = NET_RX_SUCCESS;
1109 goto out; 1110 goto out;
1110 1111
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index bceb3d72e5c3..8226b1cf05eb 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -51,7 +51,7 @@ int batadv_send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
51 } 51 }
52 52
53 /* push to the ethernet header. */ 53 /* push to the ethernet header. */
54 if (my_skb_head_push(skb, ETH_HLEN) < 0) 54 if (batadv_skb_head_push(skb, ETH_HLEN) < 0)
55 goto send_skb_err; 55 goto send_skb_err;
56 56
57 skb_reset_mac_header(skb); 57 skb_reset_mac_header(skb);
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index e15d474bd0b0..cbc36f0ec242 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -61,7 +61,7 @@ static const struct ethtool_ops bat_ethtool_ops = {
61 .get_sset_count = batadv_get_sset_count, 61 .get_sset_count = batadv_get_sset_count,
62}; 62};
63 63
64int my_skb_head_push(struct sk_buff *skb, unsigned int len) 64int batadv_skb_head_push(struct sk_buff *skb, unsigned int len)
65{ 65{
66 int result; 66 int result;
67 67
@@ -204,7 +204,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
204 if (!primary_if) 204 if (!primary_if)
205 goto dropped; 205 goto dropped;
206 206
207 if (my_skb_head_push(skb, sizeof(*bcast_packet)) < 0) 207 if (batadv_skb_head_push(skb, sizeof(*bcast_packet)) < 0)
208 goto dropped; 208 goto dropped;
209 209
210 bcast_packet = (struct bcast_packet *)skb->data; 210 bcast_packet = (struct bcast_packet *)skb->data;
@@ -256,9 +256,9 @@ end:
256 return NETDEV_TX_OK; 256 return NETDEV_TX_OK;
257} 257}
258 258
259void interface_rx(struct net_device *soft_iface, 259void batadv_interface_rx(struct net_device *soft_iface,
260 struct sk_buff *skb, struct hard_iface *recv_if, 260 struct sk_buff *skb, struct hard_iface *recv_if,
261 int hdr_size) 261 int hdr_size)
262{ 262{
263 struct bat_priv *bat_priv = netdev_priv(soft_iface); 263 struct bat_priv *bat_priv = netdev_priv(soft_iface);
264 struct ethhdr *ethhdr; 264 struct ethhdr *ethhdr;
@@ -357,7 +357,7 @@ static void interface_setup(struct net_device *dev)
357 memset(priv, 0, sizeof(*priv)); 357 memset(priv, 0, sizeof(*priv));
358} 358}
359 359
360struct net_device *softif_create(const char *name) 360struct net_device *batadv_softif_create(const char *name)
361{ 361{
362 struct net_device *soft_iface; 362 struct net_device *soft_iface;
363 struct bat_priv *bat_priv; 363 struct bat_priv *bat_priv;
@@ -445,7 +445,7 @@ out:
445 return NULL; 445 return NULL;
446} 446}
447 447
448void softif_destroy(struct net_device *soft_iface) 448void batadv_softif_destroy(struct net_device *soft_iface)
449{ 449{
450 batadv_debugfs_del_meshif(soft_iface); 450 batadv_debugfs_del_meshif(soft_iface);
451 batadv_sysfs_del_meshif(soft_iface); 451 batadv_sysfs_del_meshif(soft_iface);
@@ -453,7 +453,7 @@ void softif_destroy(struct net_device *soft_iface)
453 unregister_netdevice(soft_iface); 453 unregister_netdevice(soft_iface);
454} 454}
455 455
456int softif_is_valid(const struct net_device *net_dev) 456int batadv_softif_is_valid(const struct net_device *net_dev)
457{ 457{
458 if (net_dev->netdev_ops->ndo_start_xmit == interface_tx) 458 if (net_dev->netdev_ops->ndo_start_xmit == interface_tx)
459 return 1; 459 return 1;
diff --git a/net/batman-adv/soft-interface.h b/net/batman-adv/soft-interface.h
index 020300673884..7e2bfafbcb79 100644
--- a/net/batman-adv/soft-interface.h
+++ b/net/batman-adv/soft-interface.h
@@ -22,12 +22,11 @@
22#ifndef _NET_BATMAN_ADV_SOFT_INTERFACE_H_ 22#ifndef _NET_BATMAN_ADV_SOFT_INTERFACE_H_
23#define _NET_BATMAN_ADV_SOFT_INTERFACE_H_ 23#define _NET_BATMAN_ADV_SOFT_INTERFACE_H_
24 24
25int my_skb_head_push(struct sk_buff *skb, unsigned int len); 25int batadv_skb_head_push(struct sk_buff *skb, unsigned int len);
26void interface_rx(struct net_device *soft_iface, 26void batadv_interface_rx(struct net_device *soft_iface, struct sk_buff *skb,
27 struct sk_buff *skb, struct hard_iface *recv_if, 27 struct hard_iface *recv_if, int hdr_size);
28 int hdr_size); 28struct net_device *batadv_softif_create(const char *name);
29struct net_device *softif_create(const char *name); 29void batadv_softif_destroy(struct net_device *soft_iface);
30void softif_destroy(struct net_device *soft_iface); 30int batadv_softif_is_valid(const struct net_device *net_dev);
31int softif_is_valid(const struct net_device *net_dev);
32 31
33#endif /* _NET_BATMAN_ADV_SOFT_INTERFACE_H_ */ 32#endif /* _NET_BATMAN_ADV_SOFT_INTERFACE_H_ */
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
index 6bb3bb9f843f..52179c8ae9bd 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
@@ -242,8 +242,8 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
242 memcpy(&tmp_uc, unicast_packet, uc_hdr_len); 242 memcpy(&tmp_uc, unicast_packet, uc_hdr_len);
243 skb_split(skb, frag_skb, data_len / 2 + uc_hdr_len); 243 skb_split(skb, frag_skb, data_len / 2 + uc_hdr_len);
244 244
245 if (my_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 || 245 if (batadv_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 ||
246 my_skb_head_push(frag_skb, ucf_hdr_len) < 0) 246 batadv_skb_head_push(frag_skb, ucf_hdr_len) < 0)
247 goto drop_frag; 247 goto drop_frag;
248 248
249 frag1 = (struct unicast_frag_packet *)skb->data; 249 frag1 = (struct unicast_frag_packet *)skb->data;
@@ -314,7 +314,7 @@ find_router:
314 if (!neigh_node) 314 if (!neigh_node)
315 goto out; 315 goto out;
316 316
317 if (my_skb_head_push(skb, sizeof(*unicast_packet)) < 0) 317 if (batadv_skb_head_push(skb, sizeof(*unicast_packet)) < 0)
318 goto out; 318 goto out;
319 319
320 unicast_packet = (struct unicast_packet *)skb->data; 320 unicast_packet = (struct unicast_packet *)skb->data;