aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-12 07:38:47 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-20 16:15:17 -0400
commit08adf1512298201a53b88bb0a3d67e0dbbe0ed9b (patch)
treec0300fbf9717978726becbbdf14f1332178e78cd
parent0f5f9322681887ca221707afafe4216b6db5d22f (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>
-rw-r--r--net/batman-adv/bat_debugfs.c3
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c28
-rw-r--r--net/batman-adv/bridge_loop_avoidance.h67
-rw-r--r--net/batman-adv/hard-interface.c2
-rw-r--r--net/batman-adv/main.c4
-rw-r--r--net/batman-adv/routing.c6
-rw-r--r--net/batman-adv/soft-interface.c4
-rw-r--r--net/batman-adv/translation-table.c6
8 files changed, 62 insertions, 58 deletions
diff --git a/net/batman-adv/bat_debugfs.c b/net/batman-adv/bat_debugfs.c
index 444d10bc955..71b225c1b5c 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)
249static int bla_claim_table_open(struct inode *inode, struct file *file) 249static 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 314e37b272a..b0561e338ae 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 */
1022void bla_update_orig_address(struct bat_priv *bat_priv, 1022void 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;
1136static struct lock_class_key backbone_hash_lock_class_key; 1136static struct lock_class_key backbone_hash_lock_class_key;
1137 1137
1138/* initialize all bla structures */ 1138/* initialize all bla structures */
1139int bla_init(struct bat_priv *bat_priv) 1139int 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
1202int bla_check_bcast_duplist(struct bat_priv *bat_priv, 1202int 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
1263int bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig) 1263int 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 */
1304int bla_is_backbone_gw(struct sk_buff *skb, 1304int 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) */
1342void bla_free(struct bat_priv *bat_priv) 1342void 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 */
1377int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) 1377int 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 */
1466int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) 1466int 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
1540int bla_claim_table_seq_print_text(struct seq_file *seq, void *offset) 1540int 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 e39f93acc28..546cd641012 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
26int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid); 26int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid);
27int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid); 27int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid);
28int bla_is_backbone_gw(struct sk_buff *skb, 28int 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);
30int bla_claim_table_seq_print_text(struct seq_file *seq, void *offset); 30int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset);
31int bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig); 31int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig);
32int bla_check_bcast_duplist(struct bat_priv *bat_priv, 32int 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,
34void bla_update_orig_address(struct bat_priv *bat_priv, 34 int hdr_size);
35 struct hard_iface *primary_if, 35void batadv_bla_update_orig_address(struct bat_priv *bat_priv,
36 struct hard_iface *oldif); 36 struct hard_iface *primary_if,
37int bla_init(struct bat_priv *bat_priv); 37 struct hard_iface *oldif);
38void bla_free(struct bat_priv *bat_priv); 38int batadv_bla_init(struct bat_priv *bat_priv);
39void 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
43static inline int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, 44static 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
49static inline int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, 50static 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
55static inline int bla_is_backbone_gw(struct sk_buff *skb, 56static 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
62static inline int bla_claim_table_seq_print_text(struct seq_file *seq, 63static 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
68static inline int bla_is_backbone_gw_orig(struct bat_priv *bat_priv, 69static 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
74static inline int bla_check_bcast_duplist(struct bat_priv *bat_priv, 75static inline int
75 struct bcast_packet *bcast_packet, 76batadv_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
81static inline void bla_update_orig_address(struct bat_priv *bat_priv, 83static inline void
82 struct hard_iface *primary_if, 84batadv_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
87static inline int bla_init(struct bat_priv *bat_priv) 90static inline int batadv_bla_init(struct bat_priv *bat_priv)
88{ 91{
89 return 1; 92 return 1;
90} 93}
91 94
92static inline void bla_free(struct bat_priv *bat_priv) 95static 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 380572e721e..1643e7fca6c 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);
122out: 122out:
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 46a35e1c67c..3e1bb7a1f8b 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 e573c32a619..5b5feb496d8 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 11bfe533e2a..16e866ad175 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 a1a51cc9d88..bb8557ea30f 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