aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_sysfs.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-11 20:09:31 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-20 16:15:20 -0400
commit9563877ea52ea18bb4f1ed724c5e3a39bbbcf60b (patch)
tree56bd2312e4aa7d04b448edd1d8ed87309c941f80 /net/batman-adv/bat_sysfs.c
parent84d5e5e003752bc56b413f8d2c3fcfeeec066145 (diff)
batman-adv: Prefix hard-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/batman-adv/bat_sysfs.c')
-rw-r--r--net/batman-adv/bat_sysfs.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/net/batman-adv/bat_sysfs.c b/net/batman-adv/bat_sysfs.c
index a8fb66095d83..5a7b042873e1 100644
--- a/net/batman-adv/bat_sysfs.c
+++ b/net/batman-adv/bat_sysfs.c
@@ -122,9 +122,10 @@ ssize_t store_##_name(struct kobject *kobj, struct attribute *attr, \
122 char *buff, size_t count) \ 122 char *buff, size_t count) \
123{ \ 123{ \
124 struct net_device *net_dev = kobj_to_netdev(kobj); \ 124 struct net_device *net_dev = kobj_to_netdev(kobj); \
125 struct hard_iface *hard_iface = hardif_get_by_netdev(net_dev); \ 125 struct hard_iface *hard_iface; \
126 ssize_t length; \ 126 ssize_t length; \
127 \ 127 \
128 hard_iface = batadv_hardif_get_by_netdev(net_dev); \
128 if (!hard_iface) \ 129 if (!hard_iface) \
129 return 0; \ 130 return 0; \
130 \ 131 \
@@ -140,9 +141,10 @@ ssize_t show_##_name(struct kobject *kobj, \
140 struct attribute *attr, char *buff) \ 141 struct attribute *attr, char *buff) \
141{ \ 142{ \
142 struct net_device *net_dev = kobj_to_netdev(kobj); \ 143 struct net_device *net_dev = kobj_to_netdev(kobj); \
143 struct hard_iface *hard_iface = hardif_get_by_netdev(net_dev); \ 144 struct hard_iface *hard_iface; \
144 ssize_t length; \ 145 ssize_t length; \
145 \ 146 \
147 hard_iface = batadv_hardif_get_by_netdev(net_dev); \
146 if (!hard_iface) \ 148 if (!hard_iface) \
147 return 0; \ 149 return 0; \
148 \ 150 \
@@ -433,7 +435,7 @@ BAT_ATTR_SIF_BOOL(bonding, S_IRUGO | S_IWUSR, NULL);
433#ifdef CONFIG_BATMAN_ADV_BLA 435#ifdef CONFIG_BATMAN_ADV_BLA
434BAT_ATTR_SIF_BOOL(bridge_loop_avoidance, S_IRUGO | S_IWUSR, NULL); 436BAT_ATTR_SIF_BOOL(bridge_loop_avoidance, S_IRUGO | S_IWUSR, NULL);
435#endif 437#endif
436BAT_ATTR_SIF_BOOL(fragmentation, S_IRUGO | S_IWUSR, update_min_mtu); 438BAT_ATTR_SIF_BOOL(fragmentation, S_IRUGO | S_IWUSR, batadv_update_min_mtu);
437BAT_ATTR_SIF_BOOL(ap_isolation, S_IRUGO | S_IWUSR, NULL); 439BAT_ATTR_SIF_BOOL(ap_isolation, S_IRUGO | S_IWUSR, NULL);
438static BAT_ATTR(vis_mode, S_IRUGO | S_IWUSR, show_vis_mode, store_vis_mode); 440static BAT_ATTR(vis_mode, S_IRUGO | S_IWUSR, show_vis_mode, store_vis_mode);
439static BAT_ATTR(routing_algo, S_IRUGO, show_bat_algo, NULL); 441static BAT_ATTR(routing_algo, S_IRUGO, show_bat_algo, NULL);
@@ -523,7 +525,7 @@ static ssize_t show_mesh_iface(struct kobject *kobj, struct attribute *attr,
523 char *buff) 525 char *buff)
524{ 526{
525 struct net_device *net_dev = kobj_to_netdev(kobj); 527 struct net_device *net_dev = kobj_to_netdev(kobj);
526 struct hard_iface *hard_iface = hardif_get_by_netdev(net_dev); 528 struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev);
527 ssize_t length; 529 ssize_t length;
528 530
529 if (!hard_iface) 531 if (!hard_iface)
@@ -541,7 +543,7 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
541 char *buff, size_t count) 543 char *buff, size_t count)
542{ 544{
543 struct net_device *net_dev = kobj_to_netdev(kobj); 545 struct net_device *net_dev = kobj_to_netdev(kobj);
544 struct hard_iface *hard_iface = hardif_get_by_netdev(net_dev); 546 struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev);
545 int status_tmp = -1; 547 int status_tmp = -1;
546 int ret = count; 548 int ret = count;
547 549
@@ -576,15 +578,15 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
576 } 578 }
577 579
578 if (status_tmp == IF_NOT_IN_USE) { 580 if (status_tmp == IF_NOT_IN_USE) {
579 hardif_disable_interface(hard_iface); 581 batadv_hardif_disable_interface(hard_iface);
580 goto unlock; 582 goto unlock;
581 } 583 }
582 584
583 /* if the interface already is in use */ 585 /* if the interface already is in use */
584 if (hard_iface->if_status != IF_NOT_IN_USE) 586 if (hard_iface->if_status != IF_NOT_IN_USE)
585 hardif_disable_interface(hard_iface); 587 batadv_hardif_disable_interface(hard_iface);
586 588
587 ret = hardif_enable_interface(hard_iface, buff); 589 ret = batadv_hardif_enable_interface(hard_iface, buff);
588 590
589unlock: 591unlock:
590 rtnl_unlock(); 592 rtnl_unlock();
@@ -597,7 +599,7 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr,
597 char *buff) 599 char *buff)
598{ 600{
599 struct net_device *net_dev = kobj_to_netdev(kobj); 601 struct net_device *net_dev = kobj_to_netdev(kobj);
600 struct hard_iface *hard_iface = hardif_get_by_netdev(net_dev); 602 struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev);
601 ssize_t length; 603 ssize_t length;
602 604
603 if (!hard_iface) 605 if (!hard_iface)