aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-12 07:48:56 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-24 12:41:41 -0400
commitda641193dd3117ccd408dc589a131f16286b0da0 (patch)
treeb819cd7c61837e6c7c889e76fb9a38f6c83d4f54 /net
parentc0a559295eb2601602f7dc88f4240afcd666f73a (diff)
batman-adv: Prefix originator static inline functions with batadv_
All non-static symbols of batman-adv were prefixed with batadv_ to avoid collisions with other symbols of the kernel. Other symbols of batman-adv should use the same prefix to keep the naming scheme consistent. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c4
-rw-r--r--net/batman-adv/icmp_socket.c2
-rw-r--r--net/batman-adv/originator.c4
-rw-r--r--net/batman-adv/originator.h8
-rw-r--r--net/batman-adv/routing.c26
-rw-r--r--net/batman-adv/translation-table.c21
-rw-r--r--net/batman-adv/unicast.c2
-rw-r--r--net/batman-adv/vis.c2
8 files changed, 37 insertions, 32 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 7a2dfd41d5c8..1d143d5bb53e 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -390,7 +390,7 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv,
390 } 390 }
391 391
392 /* this is a gateway now, remove any tt entries */ 392 /* this is a gateway now, remove any tt entries */
393 orig_node = orig_hash_find(bat_priv, orig); 393 orig_node = batadv_orig_hash_find(bat_priv, orig);
394 if (orig_node) { 394 if (orig_node) {
395 batadv_tt_global_del_orig(bat_priv, orig_node, 395 batadv_tt_global_del_orig(bat_priv, orig_node,
396 "became a backbone gateway"); 396 "became a backbone gateway");
@@ -780,7 +780,7 @@ static int check_claim_group(struct bat_priv *bat_priv,
780 return 2; 780 return 2;
781 781
782 /* lets see if this originator is in our mesh */ 782 /* lets see if this originator is in our mesh */
783 orig_node = orig_hash_find(bat_priv, backbone_addr); 783 orig_node = batadv_orig_hash_find(bat_priv, backbone_addr);
784 784
785 /* dont accept claims from gateways which are not in 785 /* dont accept claims from gateways which are not in
786 * the same mesh or group. 786 * the same mesh or group.
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index 2523436907e6..50a74dadb4d6 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -213,7 +213,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
213 if (atomic_read(&bat_priv->mesh_state) != MESH_ACTIVE) 213 if (atomic_read(&bat_priv->mesh_state) != MESH_ACTIVE)
214 goto dst_unreach; 214 goto dst_unreach;
215 215
216 orig_node = orig_hash_find(bat_priv, icmp_packet->dst); 216 orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->dst);
217 if (!orig_node) 217 if (!orig_node)
218 goto dst_unreach; 218 goto dst_unreach;
219 219
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 623c23c6ec36..36f5ee5cd195 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -195,7 +195,7 @@ struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
195 int size; 195 int size;
196 int hash_added; 196 int hash_added;
197 197
198 orig_node = orig_hash_find(bat_priv, addr); 198 orig_node = batadv_orig_hash_find(bat_priv, addr);
199 if (orig_node) 199 if (orig_node)
200 return orig_node; 200 return orig_node;
201 201
@@ -249,7 +249,7 @@ struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
249 goto free_bcast_own; 249 goto free_bcast_own;
250 250
251 hash_added = batadv_hash_add(bat_priv->orig_hash, compare_orig, 251 hash_added = batadv_hash_add(bat_priv->orig_hash, compare_orig,
252 choose_orig, orig_node, 252 batadv_choose_orig, orig_node,
253 &orig_node->hash_entry); 253 &orig_node->hash_entry);
254 if (hash_added != 0) 254 if (hash_added != 0)
255 goto free_bcast_own_sum; 255 goto free_bcast_own_sum;
diff --git a/net/batman-adv/originator.h b/net/batman-adv/originator.h
index a72171997056..c4f63b4d54a7 100644
--- a/net/batman-adv/originator.h
+++ b/net/batman-adv/originator.h
@@ -41,7 +41,7 @@ int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num);
41/* hashfunction to choose an entry in a hash table of given size 41/* hashfunction to choose an entry in a hash table of given size
42 * hash algorithm from http://en.wikipedia.org/wiki/Hash_table 42 * hash algorithm from http://en.wikipedia.org/wiki/Hash_table
43 */ 43 */
44static inline uint32_t choose_orig(const void *data, uint32_t size) 44static inline uint32_t batadv_choose_orig(const void *data, uint32_t size)
45{ 45{
46 const unsigned char *key = data; 46 const unsigned char *key = data;
47 uint32_t hash = 0; 47 uint32_t hash = 0;
@@ -60,8 +60,8 @@ static inline uint32_t choose_orig(const void *data, uint32_t size)
60 return hash % size; 60 return hash % size;
61} 61}
62 62
63static inline struct orig_node *orig_hash_find(struct bat_priv *bat_priv, 63static inline struct orig_node *batadv_orig_hash_find(struct bat_priv *bat_priv,
64 const void *data) 64 const void *data)
65{ 65{
66 struct hashtable_t *hash = bat_priv->orig_hash; 66 struct hashtable_t *hash = bat_priv->orig_hash;
67 struct hlist_head *head; 67 struct hlist_head *head;
@@ -72,7 +72,7 @@ static inline struct orig_node *orig_hash_find(struct bat_priv *bat_priv,
72 if (!hash) 72 if (!hash)
73 return NULL; 73 return NULL;
74 74
75 index = choose_orig(data, hash->size); 75 index = batadv_choose_orig(data, hash->size);
76 head = &hash->table[index]; 76 head = &hash->table[index];
77 77
78 rcu_read_lock(); 78 rcu_read_lock();
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 9c6edc23bfc4..0888f1e39fdc 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -298,7 +298,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
298 298
299 /* answer echo request (ping) */ 299 /* answer echo request (ping) */
300 /* get routing information */ 300 /* get routing information */
301 orig_node = orig_hash_find(bat_priv, icmp_packet->orig); 301 orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->orig);
302 if (!orig_node) 302 if (!orig_node)
303 goto out; 303 goto out;
304 304
@@ -353,7 +353,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
353 goto out; 353 goto out;
354 354
355 /* get routing information */ 355 /* get routing information */
356 orig_node = orig_hash_find(bat_priv, icmp_packet->orig); 356 orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->orig);
357 if (!orig_node) 357 if (!orig_node)
358 goto out; 358 goto out;
359 359
@@ -437,7 +437,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
437 return recv_icmp_ttl_exceeded(bat_priv, skb); 437 return recv_icmp_ttl_exceeded(bat_priv, skb);
438 438
439 /* get routing information */ 439 /* get routing information */
440 orig_node = orig_hash_find(bat_priv, icmp_packet->dst); 440 orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->dst);
441 if (!orig_node) 441 if (!orig_node)
442 goto out; 442 goto out;
443 443
@@ -684,7 +684,7 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
684 if (batadv_bla_is_backbone_gw_orig(bat_priv, roam_adv_packet->src)) 684 if (batadv_bla_is_backbone_gw_orig(bat_priv, roam_adv_packet->src))
685 goto out; 685 goto out;
686 686
687 orig_node = orig_hash_find(bat_priv, roam_adv_packet->src); 687 orig_node = batadv_orig_hash_find(bat_priv, roam_adv_packet->src);
688 if (!orig_node) 688 if (!orig_node)
689 goto out; 689 goto out;
690 690
@@ -721,6 +721,7 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
721 struct neigh_node *router; 721 struct neigh_node *router;
722 static uint8_t zero_mac[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; 722 static uint8_t zero_mac[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
723 int bonding_enabled; 723 int bonding_enabled;
724 uint8_t *primary_addr;
724 725
725 if (!orig_node) 726 if (!orig_node)
726 return NULL; 727 return NULL;
@@ -743,20 +744,22 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
743 if ((!recv_if) && (!bonding_enabled)) 744 if ((!recv_if) && (!bonding_enabled))
744 goto return_router; 745 goto return_router;
745 746
747 primary_addr = router_orig->primary_addr;
748
746 /* if we have something in the primary_addr, we can search 749 /* if we have something in the primary_addr, we can search
747 * for a potential bonding candidate. 750 * for a potential bonding candidate.
748 */ 751 */
749 if (compare_eth(router_orig->primary_addr, zero_mac)) 752 if (compare_eth(primary_addr, zero_mac))
750 goto return_router; 753 goto return_router;
751 754
752 /* find the orig_node which has the primary interface. might 755 /* find the orig_node which has the primary interface. might
753 * even be the same as our router_orig in many cases 756 * even be the same as our router_orig in many cases
754 */ 757 */
755 if (compare_eth(router_orig->primary_addr, router_orig->orig)) { 758 if (compare_eth(primary_addr, router_orig->orig)) {
756 primary_orig_node = router_orig; 759 primary_orig_node = router_orig;
757 } else { 760 } else {
758 primary_orig_node = orig_hash_find(bat_priv, 761 primary_orig_node = batadv_orig_hash_find(bat_priv,
759 router_orig->primary_addr); 762 primary_addr);
760 if (!primary_orig_node) 763 if (!primary_orig_node)
761 goto return_router; 764 goto return_router;
762 765
@@ -839,7 +842,7 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
839 } 842 }
840 843
841 /* get routing information */ 844 /* get routing information */
842 orig_node = orig_hash_find(bat_priv, unicast_packet->dest); 845 orig_node = batadv_orig_hash_find(bat_priv, unicast_packet->dest);
843 846
844 if (!orig_node) 847 if (!orig_node)
845 goto out; 848 goto out;
@@ -922,7 +925,8 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
922 tt_poss_change = bat_priv->tt_poss_change; 925 tt_poss_change = bat_priv->tt_poss_change;
923 curr_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn); 926 curr_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn);
924 } else { 927 } else {
925 orig_node = orig_hash_find(bat_priv, unicast_packet->dest); 928 orig_node = batadv_orig_hash_find(bat_priv,
929 unicast_packet->dest);
926 930
927 if (!orig_node) 931 if (!orig_node)
928 return 0; 932 return 0;
@@ -1078,7 +1082,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
1078 if (bcast_packet->header.ttl < 2) 1082 if (bcast_packet->header.ttl < 2)
1079 goto out; 1083 goto out;
1080 1084
1081 orig_node = orig_hash_find(bat_priv, bcast_packet->orig); 1085 orig_node = batadv_orig_hash_find(bat_priv, bcast_packet->orig);
1082 1086
1083 if (!orig_node) 1087 if (!orig_node)
1084 goto out; 1088 goto out;
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 72a8548515ae..1dfa2311bb1b 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -61,7 +61,7 @@ static struct tt_common_entry *tt_hash_find(struct hashtable_t *hash,
61 if (!hash) 61 if (!hash)
62 return NULL; 62 return NULL;
63 63
64 index = choose_orig(data, hash->size); 64 index = batadv_choose_orig(data, hash->size);
65 head = &hash->table[index]; 65 head = &hash->table[index];
66 66
67 rcu_read_lock(); 67 rcu_read_lock();
@@ -235,7 +235,8 @@ void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
235 tt_local_entry->common.flags |= TT_CLIENT_NEW; 235 tt_local_entry->common.flags |= TT_CLIENT_NEW;
236 236
237 hash_added = batadv_hash_add(bat_priv->tt_local_hash, compare_tt, 237 hash_added = batadv_hash_add(bat_priv->tt_local_hash, compare_tt,
238 choose_orig, &tt_local_entry->common, 238 batadv_choose_orig,
239 &tt_local_entry->common,
239 &tt_local_entry->common.hash_entry); 240 &tt_local_entry->common.hash_entry);
240 241
241 if (unlikely(hash_added != 0)) { 242 if (unlikely(hash_added != 0)) {
@@ -639,7 +640,7 @@ int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
639 spin_lock_init(&tt_global_entry->list_lock); 640 spin_lock_init(&tt_global_entry->list_lock);
640 641
641 hash_added = batadv_hash_add(bat_priv->tt_global_hash, 642 hash_added = batadv_hash_add(bat_priv->tt_global_hash,
642 compare_tt, choose_orig, 643 compare_tt, batadv_choose_orig,
643 common, &common->hash_entry); 644 common, &common->hash_entry);
644 645
645 if (unlikely(hash_added != 0)) { 646 if (unlikely(hash_added != 0)) {
@@ -818,8 +819,8 @@ static void tt_global_del_struct(struct bat_priv *bat_priv,
818 "Deleting global tt entry %pM: %s\n", 819 "Deleting global tt entry %pM: %s\n",
819 tt_global_entry->common.addr, message); 820 tt_global_entry->common.addr, message);
820 821
821 batadv_hash_remove(bat_priv->tt_global_hash, compare_tt, choose_orig, 822 batadv_hash_remove(bat_priv->tt_global_hash, compare_tt,
822 tt_global_entry->common.addr); 823 batadv_choose_orig, tt_global_entry->common.addr);
823 tt_global_entry_free_ref(tt_global_entry); 824 tt_global_entry_free_ref(tt_global_entry);
824 825
825} 826}
@@ -1454,11 +1455,11 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
1454 (tt_request->flags & TT_FULL_TABLE ? 'F' : '.')); 1455 (tt_request->flags & TT_FULL_TABLE ? 'F' : '.'));
1455 1456
1456 /* Let's get the orig node of the REAL destination */ 1457 /* Let's get the orig node of the REAL destination */
1457 req_dst_orig_node = orig_hash_find(bat_priv, tt_request->dst); 1458 req_dst_orig_node = batadv_orig_hash_find(bat_priv, tt_request->dst);
1458 if (!req_dst_orig_node) 1459 if (!req_dst_orig_node)
1459 goto out; 1460 goto out;
1460 1461
1461 res_dst_orig_node = orig_hash_find(bat_priv, tt_request->src); 1462 res_dst_orig_node = batadv_orig_hash_find(bat_priv, tt_request->src);
1462 if (!res_dst_orig_node) 1463 if (!res_dst_orig_node)
1463 goto out; 1464 goto out;
1464 1465
@@ -1586,7 +1587,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
1586 my_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn); 1587 my_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn);
1587 req_ttvn = tt_request->ttvn; 1588 req_ttvn = tt_request->ttvn;
1588 1589
1589 orig_node = orig_hash_find(bat_priv, tt_request->src); 1590 orig_node = batadv_orig_hash_find(bat_priv, tt_request->src);
1590 if (!orig_node) 1591 if (!orig_node)
1591 goto out; 1592 goto out;
1592 1593
@@ -1731,7 +1732,7 @@ static void tt_fill_gtable(struct bat_priv *bat_priv,
1731{ 1732{
1732 struct orig_node *orig_node = NULL; 1733 struct orig_node *orig_node = NULL;
1733 1734
1734 orig_node = orig_hash_find(bat_priv, tt_response->src); 1735 orig_node = batadv_orig_hash_find(bat_priv, tt_response->src);
1735 if (!orig_node) 1736 if (!orig_node)
1736 goto out; 1737 goto out;
1737 1738
@@ -1804,7 +1805,7 @@ void batadv_handle_tt_response(struct bat_priv *bat_priv,
1804 if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_response->src)) 1805 if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_response->src))
1805 goto out; 1806 goto out;
1806 1807
1807 orig_node = orig_hash_find(bat_priv, tt_response->src); 1808 orig_node = batadv_orig_hash_find(bat_priv, tt_response->src);
1808 if (!orig_node) 1809 if (!orig_node)
1809 goto out; 1810 goto out;
1810 1811
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
index fff34e05a5d9..d021055ad262 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
@@ -181,7 +181,7 @@ int batadv_frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
181 181
182 *new_skb = NULL; 182 *new_skb = NULL;
183 183
184 orig_node = orig_hash_find(bat_priv, unicast_packet->orig); 184 orig_node = batadv_orig_hash_find(bat_priv, unicast_packet->orig);
185 if (!orig_node) 185 if (!orig_node)
186 goto out; 186 goto out;
187 187
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index e0a90570d667..bf72c5248662 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -803,7 +803,7 @@ static void unicast_vis_packet(struct bat_priv *bat_priv,
803 803
804 packet = (struct vis_packet *)info->skb_packet->data; 804 packet = (struct vis_packet *)info->skb_packet->data;
805 805
806 orig_node = orig_hash_find(bat_priv, packet->target_orig); 806 orig_node = batadv_orig_hash_find(bat_priv, packet->target_orig);
807 if (!orig_node) 807 if (!orig_node)
808 goto out; 808 goto out;
809 809