diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-11 20:09:41 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-20 16:15:31 -0400 |
commit | d0f714f472967577067853acc8dabe0abc75ae8f (patch) | |
tree | 6e1fe2f2b26eb8808f92e0c96482fcc0030de8ce | |
parent | 88ed1e7772bbedfd0bb013c209f61619eca0a781 (diff) |
batman-adv: Prefix vis 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>
-rw-r--r-- | net/batman-adv/bat_debugfs.c | 2 | ||||
-rw-r--r-- | net/batman-adv/main.c | 4 | ||||
-rw-r--r-- | net/batman-adv/routing.c | 8 | ||||
-rw-r--r-- | net/batman-adv/vis.c | 20 | ||||
-rw-r--r-- | net/batman-adv/vis.h | 18 |
5 files changed, 26 insertions, 26 deletions
diff --git a/net/batman-adv/bat_debugfs.c b/net/batman-adv/bat_debugfs.c index 93cc0d14c70a..ad377aba0661 100644 --- a/net/batman-adv/bat_debugfs.c +++ b/net/batman-adv/bat_debugfs.c | |||
@@ -263,7 +263,7 @@ static int transtable_local_open(struct inode *inode, struct file *file) | |||
263 | static int vis_data_open(struct inode *inode, struct file *file) | 263 | static int vis_data_open(struct inode *inode, struct file *file) |
264 | { | 264 | { |
265 | struct net_device *net_dev = (struct net_device *)inode->i_private; | 265 | struct net_device *net_dev = (struct net_device *)inode->i_private; |
266 | return single_open(file, vis_seq_print_text, net_dev); | 266 | return single_open(file, batadv_vis_seq_print_text, net_dev); |
267 | } | 267 | } |
268 | 268 | ||
269 | struct bat_debuginfo { | 269 | struct bat_debuginfo { |
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 8d2011b8ed35..ffea3609ea41 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c | |||
@@ -121,7 +121,7 @@ int mesh_init(struct net_device *soft_iface) | |||
121 | 121 | ||
122 | batadv_tt_local_add(soft_iface, soft_iface->dev_addr, NULL_IFINDEX); | 122 | batadv_tt_local_add(soft_iface, soft_iface->dev_addr, NULL_IFINDEX); |
123 | 123 | ||
124 | ret = vis_init(bat_priv); | 124 | ret = batadv_vis_init(bat_priv); |
125 | if (ret < 0) | 125 | if (ret < 0) |
126 | goto err; | 126 | goto err; |
127 | 127 | ||
@@ -147,7 +147,7 @@ void mesh_free(struct net_device *soft_iface) | |||
147 | 147 | ||
148 | batadv_purge_outstanding_packets(bat_priv, NULL); | 148 | batadv_purge_outstanding_packets(bat_priv, NULL); |
149 | 149 | ||
150 | vis_quit(bat_priv); | 150 | batadv_vis_quit(bat_priv); |
151 | 151 | ||
152 | batadv_gw_node_purge(bat_priv); | 152 | batadv_gw_node_purge(bat_priv); |
153 | batadv_originator_free(bat_priv); | 153 | batadv_originator_free(bat_priv); |
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 4103f68ae9db..d492634dd040 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -1151,13 +1151,13 @@ int batadv_recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1151 | 1151 | ||
1152 | switch (vis_packet->vis_type) { | 1152 | switch (vis_packet->vis_type) { |
1153 | case VIS_TYPE_SERVER_SYNC: | 1153 | case VIS_TYPE_SERVER_SYNC: |
1154 | receive_server_sync_packet(bat_priv, vis_packet, | 1154 | batadv_receive_server_sync_packet(bat_priv, vis_packet, |
1155 | skb_headlen(skb)); | 1155 | skb_headlen(skb)); |
1156 | break; | 1156 | break; |
1157 | 1157 | ||
1158 | case VIS_TYPE_CLIENT_UPDATE: | 1158 | case VIS_TYPE_CLIENT_UPDATE: |
1159 | receive_client_update_packet(bat_priv, vis_packet, | 1159 | batadv_receive_client_update_packet(bat_priv, vis_packet, |
1160 | skb_headlen(skb)); | 1160 | skb_headlen(skb)); |
1161 | break; | 1161 | break; |
1162 | 1162 | ||
1163 | default: /* ignore unknown packet */ | 1163 | default: /* ignore unknown packet */ |
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c index c56737cba0e2..24040c300636 100644 --- a/net/batman-adv/vis.c +++ b/net/batman-adv/vis.c | |||
@@ -188,7 +188,7 @@ static ssize_t vis_data_read_entry(char *buff, | |||
188 | return 0; | 188 | return 0; |
189 | } | 189 | } |
190 | 190 | ||
191 | int vis_seq_print_text(struct seq_file *seq, void *offset) | 191 | int batadv_vis_seq_print_text(struct seq_file *seq, void *offset) |
192 | { | 192 | { |
193 | struct hard_iface *primary_if; | 193 | struct hard_iface *primary_if; |
194 | struct hlist_node *node; | 194 | struct hlist_node *node; |
@@ -483,9 +483,9 @@ static struct vis_info *add_packet(struct bat_priv *bat_priv, | |||
483 | } | 483 | } |
484 | 484 | ||
485 | /* handle the server sync packet, forward if needed. */ | 485 | /* handle the server sync packet, forward if needed. */ |
486 | void receive_server_sync_packet(struct bat_priv *bat_priv, | 486 | void batadv_receive_server_sync_packet(struct bat_priv *bat_priv, |
487 | struct vis_packet *vis_packet, | 487 | struct vis_packet *vis_packet, |
488 | int vis_info_len) | 488 | int vis_info_len) |
489 | { | 489 | { |
490 | struct vis_info *info; | 490 | struct vis_info *info; |
491 | int is_new, make_broadcast; | 491 | int is_new, make_broadcast; |
@@ -508,9 +508,9 @@ end: | |||
508 | } | 508 | } |
509 | 509 | ||
510 | /* handle an incoming client update packet and schedule forward if needed. */ | 510 | /* handle an incoming client update packet and schedule forward if needed. */ |
511 | void receive_client_update_packet(struct bat_priv *bat_priv, | 511 | void batadv_receive_client_update_packet(struct bat_priv *bat_priv, |
512 | struct vis_packet *vis_packet, | 512 | struct vis_packet *vis_packet, |
513 | int vis_info_len) | 513 | int vis_info_len) |
514 | { | 514 | { |
515 | struct vis_info *info; | 515 | struct vis_info *info; |
516 | struct vis_packet *packet; | 516 | struct vis_packet *packet; |
@@ -880,7 +880,7 @@ static void send_vis_packets(struct work_struct *work) | |||
880 | 880 | ||
881 | /* init the vis server. this may only be called when if_list is already | 881 | /* init the vis server. this may only be called when if_list is already |
882 | * initialized (e.g. bat0 is initialized, interfaces have been added) */ | 882 | * initialized (e.g. bat0 is initialized, interfaces have been added) */ |
883 | int vis_init(struct bat_priv *bat_priv) | 883 | int batadv_vis_init(struct bat_priv *bat_priv) |
884 | { | 884 | { |
885 | struct vis_packet *packet; | 885 | struct vis_packet *packet; |
886 | int hash_added; | 886 | int hash_added; |
@@ -944,7 +944,7 @@ free_info: | |||
944 | bat_priv->my_vis_info = NULL; | 944 | bat_priv->my_vis_info = NULL; |
945 | err: | 945 | err: |
946 | spin_unlock_bh(&bat_priv->vis_hash_lock); | 946 | spin_unlock_bh(&bat_priv->vis_hash_lock); |
947 | vis_quit(bat_priv); | 947 | batadv_vis_quit(bat_priv); |
948 | return -ENOMEM; | 948 | return -ENOMEM; |
949 | } | 949 | } |
950 | 950 | ||
@@ -959,7 +959,7 @@ static void free_info_ref(struct hlist_node *node, void *arg) | |||
959 | } | 959 | } |
960 | 960 | ||
961 | /* shutdown vis-server */ | 961 | /* shutdown vis-server */ |
962 | void vis_quit(struct bat_priv *bat_priv) | 962 | void batadv_vis_quit(struct bat_priv *bat_priv) |
963 | { | 963 | { |
964 | if (!bat_priv->vis_hash) | 964 | if (!bat_priv->vis_hash) |
965 | return; | 965 | return; |
diff --git a/net/batman-adv/vis.h b/net/batman-adv/vis.h index ee2e46e5347b..932514e4b7d7 100644 --- a/net/batman-adv/vis.h +++ b/net/batman-adv/vis.h | |||
@@ -25,14 +25,14 @@ | |||
25 | #define VIS_TIMEOUT 200000 /* timeout of vis packets | 25 | #define VIS_TIMEOUT 200000 /* timeout of vis packets |
26 | * in miliseconds */ | 26 | * in miliseconds */ |
27 | 27 | ||
28 | int vis_seq_print_text(struct seq_file *seq, void *offset); | 28 | int batadv_vis_seq_print_text(struct seq_file *seq, void *offset); |
29 | void receive_server_sync_packet(struct bat_priv *bat_priv, | 29 | void batadv_receive_server_sync_packet(struct bat_priv *bat_priv, |
30 | struct vis_packet *vis_packet, | 30 | struct vis_packet *vis_packet, |
31 | int vis_info_len); | 31 | int vis_info_len); |
32 | void receive_client_update_packet(struct bat_priv *bat_priv, | 32 | void batadv_receive_client_update_packet(struct bat_priv *bat_priv, |
33 | struct vis_packet *vis_packet, | 33 | struct vis_packet *vis_packet, |
34 | int vis_info_len); | 34 | int vis_info_len); |
35 | int vis_init(struct bat_priv *bat_priv); | 35 | int batadv_vis_init(struct bat_priv *bat_priv); |
36 | void vis_quit(struct bat_priv *bat_priv); | 36 | void batadv_vis_quit(struct bat_priv *bat_priv); |
37 | 37 | ||
38 | #endif /* _NET_BATMAN_ADV_VIS_H_ */ | 38 | #endif /* _NET_BATMAN_ADV_VIS_H_ */ |