diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-11 20:09:24 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-20 16:15:15 -0400 |
commit | 5853e22c58b318232fd6e15033ccb0852f865c0b (patch) | |
tree | 334d4d1072caa23efeff29a105c50d43637f2246 /net/batman-adv | |
parent | 40a072d777a4f417c0296e06f91297b0f3f2fa36 (diff) |
batman-adv: Prefix bat_sysfs 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/bat_sysfs.c | 12 | ||||
-rw-r--r-- | net/batman-adv/bat_sysfs.h | 13 | ||||
-rw-r--r-- | net/batman-adv/gateway_client.c | 6 | ||||
-rw-r--r-- | net/batman-adv/hard-interface.c | 4 | ||||
-rw-r--r-- | net/batman-adv/soft-interface.c | 6 |
5 files changed, 21 insertions, 20 deletions
diff --git a/net/batman-adv/bat_sysfs.c b/net/batman-adv/bat_sysfs.c index dc1edbee63df..5dce1abc35d4 100644 --- a/net/batman-adv/bat_sysfs.c +++ b/net/batman-adv/bat_sysfs.c | |||
@@ -469,7 +469,7 @@ static struct bat_attribute *mesh_attrs[] = { | |||
469 | NULL, | 469 | NULL, |
470 | }; | 470 | }; |
471 | 471 | ||
472 | int sysfs_add_meshif(struct net_device *dev) | 472 | int batadv_sysfs_add_meshif(struct net_device *dev) |
473 | { | 473 | { |
474 | struct kobject *batif_kobject = &dev->dev.kobj; | 474 | struct kobject *batif_kobject = &dev->dev.kobj; |
475 | struct bat_priv *bat_priv = netdev_priv(dev); | 475 | struct bat_priv *bat_priv = netdev_priv(dev); |
@@ -507,7 +507,7 @@ out: | |||
507 | return -ENOMEM; | 507 | return -ENOMEM; |
508 | } | 508 | } |
509 | 509 | ||
510 | void sysfs_del_meshif(struct net_device *dev) | 510 | void batadv_sysfs_del_meshif(struct net_device *dev) |
511 | { | 511 | { |
512 | struct bat_priv *bat_priv = netdev_priv(dev); | 512 | struct bat_priv *bat_priv = netdev_priv(dev); |
513 | struct bat_attribute **bat_attr; | 513 | struct bat_attribute **bat_attr; |
@@ -637,7 +637,7 @@ static struct bat_attribute *batman_attrs[] = { | |||
637 | NULL, | 637 | NULL, |
638 | }; | 638 | }; |
639 | 639 | ||
640 | int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev) | 640 | int batadv_sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev) |
641 | { | 641 | { |
642 | struct kobject *hardif_kobject = &dev->dev.kobj; | 642 | struct kobject *hardif_kobject = &dev->dev.kobj; |
643 | struct bat_attribute **bat_attr; | 643 | struct bat_attribute **bat_attr; |
@@ -671,14 +671,14 @@ out: | |||
671 | return -ENOMEM; | 671 | return -ENOMEM; |
672 | } | 672 | } |
673 | 673 | ||
674 | void sysfs_del_hardif(struct kobject **hardif_obj) | 674 | void batadv_sysfs_del_hardif(struct kobject **hardif_obj) |
675 | { | 675 | { |
676 | kobject_put(*hardif_obj); | 676 | kobject_put(*hardif_obj); |
677 | *hardif_obj = NULL; | 677 | *hardif_obj = NULL; |
678 | } | 678 | } |
679 | 679 | ||
680 | int throw_uevent(struct bat_priv *bat_priv, enum uev_type type, | 680 | int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type, |
681 | enum uev_action action, const char *data) | 681 | enum uev_action action, const char *data) |
682 | { | 682 | { |
683 | int ret = -ENOMEM; | 683 | int ret = -ENOMEM; |
684 | struct hard_iface *primary_if = NULL; | 684 | struct hard_iface *primary_if = NULL; |
diff --git a/net/batman-adv/bat_sysfs.h b/net/batman-adv/bat_sysfs.h index fece77ae586e..f01aea836b98 100644 --- a/net/batman-adv/bat_sysfs.h +++ b/net/batman-adv/bat_sysfs.h | |||
@@ -34,11 +34,12 @@ struct bat_attribute { | |||
34 | char *buf, size_t count); | 34 | char *buf, size_t count); |
35 | }; | 35 | }; |
36 | 36 | ||
37 | int sysfs_add_meshif(struct net_device *dev); | 37 | int batadv_sysfs_add_meshif(struct net_device *dev); |
38 | void sysfs_del_meshif(struct net_device *dev); | 38 | void batadv_sysfs_del_meshif(struct net_device *dev); |
39 | int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev); | 39 | int batadv_sysfs_add_hardif(struct kobject **hardif_obj, |
40 | void sysfs_del_hardif(struct kobject **hardif_obj); | 40 | struct net_device *dev); |
41 | int throw_uevent(struct bat_priv *bat_priv, enum uev_type type, | 41 | void batadv_sysfs_del_hardif(struct kobject **hardif_obj); |
42 | enum uev_action action, const char *data); | 42 | int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type, |
43 | enum uev_action action, const char *data); | ||
43 | 44 | ||
44 | #endif /* _NET_BATMAN_ADV_SYSFS_H_ */ | 45 | #endif /* _NET_BATMAN_ADV_SYSFS_H_ */ |
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index 47f7186dcefc..1d7f08e026f3 100644 --- a/net/batman-adv/gateway_client.c +++ b/net/batman-adv/gateway_client.c | |||
@@ -220,19 +220,19 @@ void gw_election(struct bat_priv *bat_priv) | |||
220 | if ((curr_gw) && (!next_gw)) { | 220 | if ((curr_gw) && (!next_gw)) { |
221 | bat_dbg(DBG_BATMAN, bat_priv, | 221 | bat_dbg(DBG_BATMAN, bat_priv, |
222 | "Removing selected gateway - no gateway in range\n"); | 222 | "Removing selected gateway - no gateway in range\n"); |
223 | throw_uevent(bat_priv, UEV_GW, UEV_DEL, NULL); | 223 | batadv_throw_uevent(bat_priv, UEV_GW, UEV_DEL, NULL); |
224 | } else if ((!curr_gw) && (next_gw)) { | 224 | } else if ((!curr_gw) && (next_gw)) { |
225 | bat_dbg(DBG_BATMAN, bat_priv, | 225 | bat_dbg(DBG_BATMAN, bat_priv, |
226 | "Adding route to gateway %pM (gw_flags: %i, tq: %i)\n", | 226 | "Adding route to gateway %pM (gw_flags: %i, tq: %i)\n", |
227 | next_gw->orig_node->orig, next_gw->orig_node->gw_flags, | 227 | next_gw->orig_node->orig, next_gw->orig_node->gw_flags, |
228 | router->tq_avg); | 228 | router->tq_avg); |
229 | throw_uevent(bat_priv, UEV_GW, UEV_ADD, gw_addr); | 229 | batadv_throw_uevent(bat_priv, UEV_GW, UEV_ADD, gw_addr); |
230 | } else { | 230 | } else { |
231 | bat_dbg(DBG_BATMAN, bat_priv, | 231 | bat_dbg(DBG_BATMAN, bat_priv, |
232 | "Changing route to gateway %pM (gw_flags: %i, tq: %i)\n", | 232 | "Changing route to gateway %pM (gw_flags: %i, tq: %i)\n", |
233 | next_gw->orig_node->orig, next_gw->orig_node->gw_flags, | 233 | next_gw->orig_node->orig, next_gw->orig_node->gw_flags, |
234 | router->tq_avg); | 234 | router->tq_avg); |
235 | throw_uevent(bat_priv, UEV_GW, UEV_CHANGE, gw_addr); | 235 | batadv_throw_uevent(bat_priv, UEV_GW, UEV_CHANGE, gw_addr); |
236 | } | 236 | } |
237 | 237 | ||
238 | gw_select(bat_priv, next_gw); | 238 | gw_select(bat_priv, next_gw); |
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index ce78c6d645c6..380572e721e6 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c | |||
@@ -423,7 +423,7 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev) | |||
423 | if (!hard_iface) | 423 | if (!hard_iface) |
424 | goto release_dev; | 424 | goto release_dev; |
425 | 425 | ||
426 | ret = sysfs_add_hardif(&hard_iface->hardif_obj, net_dev); | 426 | ret = batadv_sysfs_add_hardif(&hard_iface->hardif_obj, net_dev); |
427 | if (ret) | 427 | if (ret) |
428 | goto free_if; | 428 | goto free_if; |
429 | 429 | ||
@@ -467,7 +467,7 @@ static void hardif_remove_interface(struct hard_iface *hard_iface) | |||
467 | return; | 467 | return; |
468 | 468 | ||
469 | hard_iface->if_status = IF_TO_BE_REMOVED; | 469 | hard_iface->if_status = IF_TO_BE_REMOVED; |
470 | sysfs_del_hardif(&hard_iface->hardif_obj); | 470 | batadv_sysfs_del_hardif(&hard_iface->hardif_obj); |
471 | hardif_free_ref(hard_iface); | 471 | hardif_free_ref(hard_iface); |
472 | } | 472 | } |
473 | 473 | ||
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 0f0003b00f8c..11bfe533e2a4 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c | |||
@@ -415,7 +415,7 @@ struct net_device *softif_create(const char *name) | |||
415 | if (ret < 0) | 415 | if (ret < 0) |
416 | goto free_bat_counters; | 416 | goto free_bat_counters; |
417 | 417 | ||
418 | ret = sysfs_add_meshif(soft_iface); | 418 | ret = batadv_sysfs_add_meshif(soft_iface); |
419 | if (ret < 0) | 419 | if (ret < 0) |
420 | goto free_bat_counters; | 420 | goto free_bat_counters; |
421 | 421 | ||
@@ -432,7 +432,7 @@ struct net_device *softif_create(const char *name) | |||
432 | unreg_debugfs: | 432 | unreg_debugfs: |
433 | batadv_debugfs_del_meshif(soft_iface); | 433 | batadv_debugfs_del_meshif(soft_iface); |
434 | unreg_sysfs: | 434 | unreg_sysfs: |
435 | sysfs_del_meshif(soft_iface); | 435 | batadv_sysfs_del_meshif(soft_iface); |
436 | free_bat_counters: | 436 | free_bat_counters: |
437 | free_percpu(bat_priv->bat_counters); | 437 | free_percpu(bat_priv->bat_counters); |
438 | unreg_soft_iface: | 438 | unreg_soft_iface: |
@@ -448,7 +448,7 @@ out: | |||
448 | void softif_destroy(struct net_device *soft_iface) | 448 | void softif_destroy(struct net_device *soft_iface) |
449 | { | 449 | { |
450 | batadv_debugfs_del_meshif(soft_iface); | 450 | batadv_debugfs_del_meshif(soft_iface); |
451 | sysfs_del_meshif(soft_iface); | 451 | batadv_sysfs_del_meshif(soft_iface); |
452 | mesh_free(soft_iface); | 452 | mesh_free(soft_iface); |
453 | unregister_netdevice(soft_iface); | 453 | unregister_netdevice(soft_iface); |
454 | } | 454 | } |