diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-12 07:38:47 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-20 16:15:17 -0400 |
commit | 08adf1512298201a53b88bb0a3d67e0dbbe0ed9b (patch) | |
tree | c0300fbf9717978726becbbdf14f1332178e78cd /net/batman-adv | |
parent | 0f5f9322681887ca221707afafe4216b6db5d22f (diff) |
batman-adv: Prefix bridge_loop_avoidance 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_debugfs.c | 3 | ||||
-rw-r--r-- | net/batman-adv/bridge_loop_avoidance.c | 28 | ||||
-rw-r--r-- | net/batman-adv/bridge_loop_avoidance.h | 67 | ||||
-rw-r--r-- | net/batman-adv/hard-interface.c | 2 | ||||
-rw-r--r-- | net/batman-adv/main.c | 4 | ||||
-rw-r--r-- | net/batman-adv/routing.c | 6 | ||||
-rw-r--r-- | net/batman-adv/soft-interface.c | 4 | ||||
-rw-r--r-- | net/batman-adv/translation-table.c | 6 |
8 files changed, 62 insertions, 58 deletions
diff --git a/net/batman-adv/bat_debugfs.c b/net/batman-adv/bat_debugfs.c index 444d10bc9552..71b225c1b5ca 100644 --- a/net/batman-adv/bat_debugfs.c +++ b/net/batman-adv/bat_debugfs.c | |||
@@ -249,7 +249,8 @@ static int transtable_global_open(struct inode *inode, struct file *file) | |||
249 | static int bla_claim_table_open(struct inode *inode, struct file *file) | 249 | static int bla_claim_table_open(struct inode *inode, struct file *file) |
250 | { | 250 | { |
251 | struct net_device *net_dev = (struct net_device *)inode->i_private; | 251 | struct net_device *net_dev = (struct net_device *)inode->i_private; |
252 | return single_open(file, bla_claim_table_seq_print_text, net_dev); | 252 | return single_open(file, batadv_bla_claim_table_seq_print_text, |
253 | net_dev); | ||
253 | } | 254 | } |
254 | #endif | 255 | #endif |
255 | 256 | ||
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 314e37b272a7..b0561e338ae5 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c | |||
@@ -1019,9 +1019,9 @@ purge_now: | |||
1019 | * Update the backbone gateways when the own orig address changes. | 1019 | * Update the backbone gateways when the own orig address changes. |
1020 | * | 1020 | * |
1021 | */ | 1021 | */ |
1022 | void bla_update_orig_address(struct bat_priv *bat_priv, | 1022 | void batadv_bla_update_orig_address(struct bat_priv *bat_priv, |
1023 | struct hard_iface *primary_if, | 1023 | struct hard_iface *primary_if, |
1024 | struct hard_iface *oldif) | 1024 | struct hard_iface *oldif) |
1025 | { | 1025 | { |
1026 | struct backbone_gw *backbone_gw; | 1026 | struct backbone_gw *backbone_gw; |
1027 | struct hlist_node *node; | 1027 | struct hlist_node *node; |
@@ -1136,7 +1136,7 @@ static struct lock_class_key claim_hash_lock_class_key; | |||
1136 | static struct lock_class_key backbone_hash_lock_class_key; | 1136 | static struct lock_class_key backbone_hash_lock_class_key; |
1137 | 1137 | ||
1138 | /* initialize all bla structures */ | 1138 | /* initialize all bla structures */ |
1139 | int bla_init(struct bat_priv *bat_priv) | 1139 | int batadv_bla_init(struct bat_priv *bat_priv) |
1140 | { | 1140 | { |
1141 | int i; | 1141 | int i; |
1142 | uint8_t claim_dest[ETH_ALEN] = {0xff, 0x43, 0x05, 0x00, 0x00, 0x00}; | 1142 | uint8_t claim_dest[ETH_ALEN] = {0xff, 0x43, 0x05, 0x00, 0x00, 0x00}; |
@@ -1199,9 +1199,9 @@ int bla_init(struct bat_priv *bat_priv) | |||
1199 | * | 1199 | * |
1200 | **/ | 1200 | **/ |
1201 | 1201 | ||
1202 | int bla_check_bcast_duplist(struct bat_priv *bat_priv, | 1202 | int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv, |
1203 | struct bcast_packet *bcast_packet, | 1203 | struct bcast_packet *bcast_packet, |
1204 | int hdr_size) | 1204 | int hdr_size) |
1205 | { | 1205 | { |
1206 | int i, length, curr; | 1206 | int i, length, curr; |
1207 | uint8_t *content; | 1207 | uint8_t *content; |
@@ -1260,7 +1260,7 @@ int bla_check_bcast_duplist(struct bat_priv *bat_priv, | |||
1260 | * | 1260 | * |
1261 | */ | 1261 | */ |
1262 | 1262 | ||
1263 | int bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig) | 1263 | int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig) |
1264 | { | 1264 | { |
1265 | struct hashtable_t *hash = bat_priv->backbone_hash; | 1265 | struct hashtable_t *hash = bat_priv->backbone_hash; |
1266 | struct hlist_head *head; | 1266 | struct hlist_head *head; |
@@ -1301,8 +1301,8 @@ int bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig) | |||
1301 | * returns 0. | 1301 | * returns 0. |
1302 | * | 1302 | * |
1303 | */ | 1303 | */ |
1304 | int bla_is_backbone_gw(struct sk_buff *skb, | 1304 | int batadv_bla_is_backbone_gw(struct sk_buff *skb, |
1305 | struct orig_node *orig_node, int hdr_size) | 1305 | struct orig_node *orig_node, int hdr_size) |
1306 | { | 1306 | { |
1307 | struct ethhdr *ethhdr; | 1307 | struct ethhdr *ethhdr; |
1308 | struct vlan_ethhdr *vhdr; | 1308 | struct vlan_ethhdr *vhdr; |
@@ -1339,7 +1339,7 @@ int bla_is_backbone_gw(struct sk_buff *skb, | |||
1339 | } | 1339 | } |
1340 | 1340 | ||
1341 | /* free all bla structures (for softinterface free or module unload) */ | 1341 | /* free all bla structures (for softinterface free or module unload) */ |
1342 | void bla_free(struct bat_priv *bat_priv) | 1342 | void batadv_bla_free(struct bat_priv *bat_priv) |
1343 | { | 1343 | { |
1344 | struct hard_iface *primary_if; | 1344 | struct hard_iface *primary_if; |
1345 | 1345 | ||
@@ -1374,7 +1374,7 @@ void bla_free(struct bat_priv *bat_priv) | |||
1374 | * process the skb. | 1374 | * process the skb. |
1375 | * | 1375 | * |
1376 | */ | 1376 | */ |
1377 | int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) | 1377 | int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) |
1378 | { | 1378 | { |
1379 | struct ethhdr *ethhdr; | 1379 | struct ethhdr *ethhdr; |
1380 | struct claim search_claim, *claim = NULL; | 1380 | struct claim search_claim, *claim = NULL; |
@@ -1463,7 +1463,7 @@ out: | |||
1463 | * process the skb. | 1463 | * process the skb. |
1464 | * | 1464 | * |
1465 | */ | 1465 | */ |
1466 | int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) | 1466 | int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) |
1467 | { | 1467 | { |
1468 | struct ethhdr *ethhdr; | 1468 | struct ethhdr *ethhdr; |
1469 | struct claim search_claim, *claim = NULL; | 1469 | struct claim search_claim, *claim = NULL; |
@@ -1537,7 +1537,7 @@ out: | |||
1537 | return ret; | 1537 | return ret; |
1538 | } | 1538 | } |
1539 | 1539 | ||
1540 | int bla_claim_table_seq_print_text(struct seq_file *seq, void *offset) | 1540 | int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset) |
1541 | { | 1541 | { |
1542 | struct net_device *net_dev = (struct net_device *)seq->private; | 1542 | struct net_device *net_dev = (struct net_device *)seq->private; |
1543 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 1543 | struct bat_priv *bat_priv = netdev_priv(net_dev); |
diff --git a/net/batman-adv/bridge_loop_avoidance.h b/net/batman-adv/bridge_loop_avoidance.h index e39f93acc28f..546cd641012a 100644 --- a/net/batman-adv/bridge_loop_avoidance.h +++ b/net/batman-adv/bridge_loop_avoidance.h | |||
@@ -23,73 +23,76 @@ | |||
23 | #define _NET_BATMAN_ADV_BLA_H_ | 23 | #define _NET_BATMAN_ADV_BLA_H_ |
24 | 24 | ||
25 | #ifdef CONFIG_BATMAN_ADV_BLA | 25 | #ifdef CONFIG_BATMAN_ADV_BLA |
26 | int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid); | 26 | int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid); |
27 | int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid); | 27 | int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid); |
28 | int bla_is_backbone_gw(struct sk_buff *skb, | 28 | int batadv_bla_is_backbone_gw(struct sk_buff *skb, |
29 | struct orig_node *orig_node, int hdr_size); | 29 | struct orig_node *orig_node, int hdr_size); |
30 | int bla_claim_table_seq_print_text(struct seq_file *seq, void *offset); | 30 | int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset); |
31 | int bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig); | 31 | int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig); |
32 | int bla_check_bcast_duplist(struct bat_priv *bat_priv, | 32 | int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv, |
33 | struct bcast_packet *bcast_packet, int hdr_size); | 33 | struct bcast_packet *bcast_packet, |
34 | void bla_update_orig_address(struct bat_priv *bat_priv, | 34 | int hdr_size); |
35 | struct hard_iface *primary_if, | 35 | void batadv_bla_update_orig_address(struct bat_priv *bat_priv, |
36 | struct hard_iface *oldif); | 36 | struct hard_iface *primary_if, |
37 | int bla_init(struct bat_priv *bat_priv); | 37 | struct hard_iface *oldif); |
38 | void bla_free(struct bat_priv *bat_priv); | 38 | int batadv_bla_init(struct bat_priv *bat_priv); |
39 | void batadv_bla_free(struct bat_priv *bat_priv); | ||
39 | 40 | ||
40 | #define BLA_CRC_INIT 0 | 41 | #define BLA_CRC_INIT 0 |
41 | #else /* ifdef CONFIG_BATMAN_ADV_BLA */ | 42 | #else /* ifdef CONFIG_BATMAN_ADV_BLA */ |
42 | 43 | ||
43 | static inline int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, | 44 | static inline int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, |
44 | short vid) | 45 | short vid) |
45 | { | 46 | { |
46 | return 0; | 47 | return 0; |
47 | } | 48 | } |
48 | 49 | ||
49 | static inline int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, | 50 | static inline int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, |
50 | short vid) | 51 | short vid) |
51 | { | 52 | { |
52 | return 0; | 53 | return 0; |
53 | } | 54 | } |
54 | 55 | ||
55 | static inline int bla_is_backbone_gw(struct sk_buff *skb, | 56 | static inline int batadv_bla_is_backbone_gw(struct sk_buff *skb, |
56 | struct orig_node *orig_node, | 57 | struct orig_node *orig_node, |
57 | int hdr_size) | 58 | int hdr_size) |
58 | { | 59 | { |
59 | return 0; | 60 | return 0; |
60 | } | 61 | } |
61 | 62 | ||
62 | static inline int bla_claim_table_seq_print_text(struct seq_file *seq, | 63 | static inline int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, |
63 | void *offset) | 64 | void *offset) |
64 | { | 65 | { |
65 | return 0; | 66 | return 0; |
66 | } | 67 | } |
67 | 68 | ||
68 | static inline int bla_is_backbone_gw_orig(struct bat_priv *bat_priv, | 69 | static inline int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, |
69 | uint8_t *orig) | 70 | uint8_t *orig) |
70 | { | 71 | { |
71 | return 0; | 72 | return 0; |
72 | } | 73 | } |
73 | 74 | ||
74 | static inline int bla_check_bcast_duplist(struct bat_priv *bat_priv, | 75 | static inline int |
75 | struct bcast_packet *bcast_packet, | 76 | batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv, |
76 | int hdr_size) | 77 | struct bcast_packet *bcast_packet, |
78 | int hdr_size) | ||
77 | { | 79 | { |
78 | return 0; | 80 | return 0; |
79 | } | 81 | } |
80 | 82 | ||
81 | static inline void bla_update_orig_address(struct bat_priv *bat_priv, | 83 | static inline void |
82 | struct hard_iface *primary_if, | 84 | batadv_bla_update_orig_address(struct bat_priv *bat_priv, |
83 | struct hard_iface *oldif) | 85 | struct hard_iface *primary_if, |
86 | struct hard_iface *oldif) | ||
84 | { | 87 | { |
85 | } | 88 | } |
86 | 89 | ||
87 | static inline int bla_init(struct bat_priv *bat_priv) | 90 | static inline int batadv_bla_init(struct bat_priv *bat_priv) |
88 | { | 91 | { |
89 | return 1; | 92 | return 1; |
90 | } | 93 | } |
91 | 94 | ||
92 | static inline void bla_free(struct bat_priv *bat_priv) | 95 | static inline void batadv_bla_free(struct bat_priv *bat_priv) |
93 | { | 96 | { |
94 | } | 97 | } |
95 | 98 | ||
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index 380572e721e6..1643e7fca6c6 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c | |||
@@ -118,7 +118,7 @@ static void primary_if_update_addr(struct bat_priv *bat_priv, | |||
118 | memcpy(vis_packet->sender_orig, | 118 | memcpy(vis_packet->sender_orig, |
119 | primary_if->net_dev->dev_addr, ETH_ALEN); | 119 | primary_if->net_dev->dev_addr, ETH_ALEN); |
120 | 120 | ||
121 | bla_update_orig_address(bat_priv, primary_if, oldif); | 121 | batadv_bla_update_orig_address(bat_priv, primary_if, oldif); |
122 | out: | 122 | out: |
123 | if (primary_if) | 123 | if (primary_if) |
124 | hardif_free_ref(primary_if); | 124 | hardif_free_ref(primary_if); |
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 46a35e1c67ca..3e1bb7a1f8b4 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c | |||
@@ -125,7 +125,7 @@ int mesh_init(struct net_device *soft_iface) | |||
125 | if (ret < 0) | 125 | if (ret < 0) |
126 | goto err; | 126 | goto err; |
127 | 127 | ||
128 | ret = bla_init(bat_priv); | 128 | ret = batadv_bla_init(bat_priv); |
129 | if (ret < 0) | 129 | if (ret < 0) |
130 | goto err; | 130 | goto err; |
131 | 131 | ||
@@ -154,7 +154,7 @@ void mesh_free(struct net_device *soft_iface) | |||
154 | 154 | ||
155 | tt_free(bat_priv); | 155 | tt_free(bat_priv); |
156 | 156 | ||
157 | bla_free(bat_priv); | 157 | batadv_bla_free(bat_priv); |
158 | 158 | ||
159 | free_percpu(bat_priv->bat_counters); | 159 | free_percpu(bat_priv->bat_counters); |
160 | 160 | ||
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index e573c32a619d..5b5feb496d8d 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -676,7 +676,7 @@ int recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if) | |||
676 | * roaming advertisement from it, as it has the same | 676 | * roaming advertisement from it, as it has the same |
677 | * entries as we have. | 677 | * entries as we have. |
678 | */ | 678 | */ |
679 | if (bla_is_backbone_gw_orig(bat_priv, roam_adv_packet->src)) | 679 | if (batadv_bla_is_backbone_gw_orig(bat_priv, roam_adv_packet->src)) |
680 | goto out; | 680 | goto out; |
681 | 681 | ||
682 | orig_node = orig_hash_find(bat_priv, roam_adv_packet->src); | 682 | orig_node = orig_hash_find(bat_priv, roam_adv_packet->src); |
@@ -1089,7 +1089,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1089 | spin_unlock_bh(&orig_node->bcast_seqno_lock); | 1089 | spin_unlock_bh(&orig_node->bcast_seqno_lock); |
1090 | 1090 | ||
1091 | /* check whether this has been sent by another originator before */ | 1091 | /* check whether this has been sent by another originator before */ |
1092 | if (bla_check_bcast_duplist(bat_priv, bcast_packet, hdr_size)) | 1092 | if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, hdr_size)) |
1093 | goto out; | 1093 | goto out; |
1094 | 1094 | ||
1095 | /* rebroadcast packet */ | 1095 | /* rebroadcast packet */ |
@@ -1098,7 +1098,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1098 | /* don't hand the broadcast up if it is from an originator | 1098 | /* don't hand the broadcast up if it is from an originator |
1099 | * from the same backbone. | 1099 | * from the same backbone. |
1100 | */ | 1100 | */ |
1101 | if (bla_is_backbone_gw(skb, orig_node, hdr_size)) | 1101 | if (batadv_bla_is_backbone_gw(skb, orig_node, hdr_size)) |
1102 | goto out; | 1102 | goto out; |
1103 | 1103 | ||
1104 | /* broadcast for me */ | 1104 | /* broadcast for me */ |
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 11bfe533e2a4..16e866ad1759 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c | |||
@@ -162,7 +162,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface) | |||
162 | goto dropped; | 162 | goto dropped; |
163 | } | 163 | } |
164 | 164 | ||
165 | if (bla_tx(bat_priv, skb, vid)) | 165 | if (batadv_bla_tx(bat_priv, skb, vid)) |
166 | goto dropped; | 166 | goto dropped; |
167 | 167 | ||
168 | /* Register the client MAC in the transtable */ | 168 | /* Register the client MAC in the transtable */ |
@@ -309,7 +309,7 @@ void interface_rx(struct net_device *soft_iface, | |||
309 | /* Let the bridge loop avoidance check the packet. If will | 309 | /* Let the bridge loop avoidance check the packet. If will |
310 | * not handle it, we can safely push it up. | 310 | * not handle it, we can safely push it up. |
311 | */ | 311 | */ |
312 | if (bla_rx(bat_priv, skb, vid)) | 312 | if (batadv_bla_rx(bat_priv, skb, vid)) |
313 | goto out; | 313 | goto out; |
314 | 314 | ||
315 | netif_rx(skb); | 315 | netif_rx(skb); |
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index a1a51cc9d88e..bb8557ea30f1 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -1674,7 +1674,7 @@ bool send_tt_response(struct bat_priv *bat_priv, | |||
1674 | { | 1674 | { |
1675 | if (is_my_mac(tt_request->dst)) { | 1675 | if (is_my_mac(tt_request->dst)) { |
1676 | /* don't answer backbone gws! */ | 1676 | /* don't answer backbone gws! */ |
1677 | if (bla_is_backbone_gw_orig(bat_priv, tt_request->src)) | 1677 | if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_request->src)) |
1678 | return true; | 1678 | return true; |
1679 | 1679 | ||
1680 | return send_my_tt_response(bat_priv, tt_request); | 1680 | return send_my_tt_response(bat_priv, tt_request); |
@@ -1786,7 +1786,7 @@ void handle_tt_response(struct bat_priv *bat_priv, | |||
1786 | (tt_response->flags & TT_FULL_TABLE ? 'F' : '.')); | 1786 | (tt_response->flags & TT_FULL_TABLE ? 'F' : '.')); |
1787 | 1787 | ||
1788 | /* we should have never asked a backbone gw */ | 1788 | /* we should have never asked a backbone gw */ |
1789 | if (bla_is_backbone_gw_orig(bat_priv, tt_response->src)) | 1789 | if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_response->src)) |
1790 | goto out; | 1790 | goto out; |
1791 | 1791 | ||
1792 | orig_node = orig_hash_find(bat_priv, tt_response->src); | 1792 | orig_node = orig_hash_find(bat_priv, tt_response->src); |
@@ -2163,7 +2163,7 @@ void tt_update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node, | |||
2163 | bool full_table = true; | 2163 | bool full_table = true; |
2164 | 2164 | ||
2165 | /* don't care about a backbone gateways updates. */ | 2165 | /* don't care about a backbone gateways updates. */ |
2166 | if (bla_is_backbone_gw_orig(bat_priv, orig_node->orig)) | 2166 | if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig)) |
2167 | return; | 2167 | return; |
2168 | 2168 | ||
2169 | /* orig table not initialised AND first diff is in the OGM OR the ttvn | 2169 | /* orig table not initialised AND first diff is in the OGM OR the ttvn |