diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-11 20:09:33 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-20 16:15:22 -0400 |
commit | 9039dc7e8a42864744665bf0905f48c2724f6e3e (patch) | |
tree | c59dbebe6df45722abb14d06f59be48fb09f2ed8 | |
parent | 1a8eaf0733ca754533a03d6cfa4463def2b81ce3 (diff) |
batman-adv: Prefix icmp-socket 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/icmp_socket.c | 8 | ||||
-rw-r--r-- | net/batman-adv/icmp_socket.h | 8 | ||||
-rw-r--r-- | net/batman-adv/main.c | 2 | ||||
-rw-r--r-- | net/batman-adv/routing.c | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/net/batman-adv/bat_debugfs.c b/net/batman-adv/bat_debugfs.c index 7b294b431f88..9177a0619906 100644 --- a/net/batman-adv/bat_debugfs.c +++ b/net/batman-adv/bat_debugfs.c | |||
@@ -349,7 +349,7 @@ int batadv_debugfs_add_meshif(struct net_device *dev) | |||
349 | if (!bat_priv->debug_dir) | 349 | if (!bat_priv->debug_dir) |
350 | goto out; | 350 | goto out; |
351 | 351 | ||
352 | if (bat_socket_setup(bat_priv) < 0) | 352 | if (batadv_socket_setup(bat_priv) < 0) |
353 | goto rem_attr; | 353 | goto rem_attr; |
354 | 354 | ||
355 | if (debug_log_setup(bat_priv) < 0) | 355 | if (debug_log_setup(bat_priv) < 0) |
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c index d27db8192e93..38ca3a853a2b 100644 --- a/net/batman-adv/icmp_socket.c +++ b/net/batman-adv/icmp_socket.c | |||
@@ -34,7 +34,7 @@ static void bat_socket_add_packet(struct socket_client *socket_client, | |||
34 | struct icmp_packet_rr *icmp_packet, | 34 | struct icmp_packet_rr *icmp_packet, |
35 | size_t icmp_len); | 35 | size_t icmp_len); |
36 | 36 | ||
37 | void bat_socket_init(void) | 37 | void batadv_socket_init(void) |
38 | { | 38 | { |
39 | memset(socket_client_hash, 0, sizeof(socket_client_hash)); | 39 | memset(socket_client_hash, 0, sizeof(socket_client_hash)); |
40 | } | 40 | } |
@@ -276,7 +276,7 @@ static const struct file_operations fops = { | |||
276 | .llseek = no_llseek, | 276 | .llseek = no_llseek, |
277 | }; | 277 | }; |
278 | 278 | ||
279 | int bat_socket_setup(struct bat_priv *bat_priv) | 279 | int batadv_socket_setup(struct bat_priv *bat_priv) |
280 | { | 280 | { |
281 | struct dentry *d; | 281 | struct dentry *d; |
282 | 282 | ||
@@ -336,8 +336,8 @@ static void bat_socket_add_packet(struct socket_client *socket_client, | |||
336 | wake_up(&socket_client->queue_wait); | 336 | wake_up(&socket_client->queue_wait); |
337 | } | 337 | } |
338 | 338 | ||
339 | void bat_socket_receive_packet(struct icmp_packet_rr *icmp_packet, | 339 | void batadv_socket_receive_packet(struct icmp_packet_rr *icmp_packet, |
340 | size_t icmp_len) | 340 | size_t icmp_len) |
341 | { | 341 | { |
342 | struct socket_client *hash = socket_client_hash[icmp_packet->uid]; | 342 | struct socket_client *hash = socket_client_hash[icmp_packet->uid]; |
343 | 343 | ||
diff --git a/net/batman-adv/icmp_socket.h b/net/batman-adv/icmp_socket.h index 380ed4c2443a..7b8863668490 100644 --- a/net/batman-adv/icmp_socket.h +++ b/net/batman-adv/icmp_socket.h | |||
@@ -24,9 +24,9 @@ | |||
24 | 24 | ||
25 | #define ICMP_SOCKET "socket" | 25 | #define ICMP_SOCKET "socket" |
26 | 26 | ||
27 | void bat_socket_init(void); | 27 | void batadv_socket_init(void); |
28 | int bat_socket_setup(struct bat_priv *bat_priv); | 28 | int batadv_socket_setup(struct bat_priv *bat_priv); |
29 | void bat_socket_receive_packet(struct icmp_packet_rr *icmp_packet, | 29 | void batadv_socket_receive_packet(struct icmp_packet_rr *icmp_packet, |
30 | size_t icmp_len); | 30 | size_t icmp_len); |
31 | 31 | ||
32 | #endif /* _NET_BATMAN_ADV_ICMP_SOCKET_H_ */ | 32 | #endif /* _NET_BATMAN_ADV_ICMP_SOCKET_H_ */ |
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 8e4083612523..84dbda50aa90 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c | |||
@@ -65,7 +65,7 @@ static int __init batman_init(void) | |||
65 | if (!bat_event_workqueue) | 65 | if (!bat_event_workqueue) |
66 | return -ENOMEM; | 66 | return -ENOMEM; |
67 | 67 | ||
68 | bat_socket_init(); | 68 | batadv_socket_init(); |
69 | batadv_debugfs_init(); | 69 | batadv_debugfs_init(); |
70 | 70 | ||
71 | register_netdevice_notifier(&batadv_hard_if_notifier); | 71 | register_netdevice_notifier(&batadv_hard_if_notifier); |
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 5b5feb496d8d..7525e4fd2faf 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -289,7 +289,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv, | |||
289 | 289 | ||
290 | /* add data to device queue */ | 290 | /* add data to device queue */ |
291 | if (icmp_packet->msg_type != ECHO_REQUEST) { | 291 | if (icmp_packet->msg_type != ECHO_REQUEST) { |
292 | bat_socket_receive_packet(icmp_packet, icmp_len); | 292 | batadv_socket_receive_packet(icmp_packet, icmp_len); |
293 | goto out; | 293 | goto out; |
294 | } | 294 | } |
295 | 295 | ||