diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-11 20:09:39 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-20 16:15:29 -0400 |
commit | 08c36d3e8ad1f73d3b0322842363b23f6d203630 (patch) | |
tree | 9190100a886c18956fee193acbd8fd160060bc19 /net/batman-adv/routing.c | |
parent | 04b482a21aaf22cf5b327fb6a3fba6fdc8cb3de9 (diff) |
batman-adv: Prefix translation-table 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/routing.c')
-rw-r--r-- | net/batman-adv/routing.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 0e982218e630..8fb5ae3dee87 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -75,8 +75,8 @@ static void _update_route(struct bat_priv *bat_priv, | |||
75 | if ((curr_router) && (!neigh_node)) { | 75 | if ((curr_router) && (!neigh_node)) { |
76 | bat_dbg(DBG_ROUTES, bat_priv, "Deleting route towards: %pM\n", | 76 | bat_dbg(DBG_ROUTES, bat_priv, "Deleting route towards: %pM\n", |
77 | orig_node->orig); | 77 | orig_node->orig); |
78 | tt_global_del_orig(bat_priv, orig_node, | 78 | batadv_tt_global_del_orig(bat_priv, orig_node, |
79 | "Deleted route towards originator"); | 79 | "Deleted route towards originator"); |
80 | 80 | ||
81 | /* route added */ | 81 | /* route added */ |
82 | } else if ((!curr_router) && (neigh_node)) { | 82 | } else if ((!curr_router) && (neigh_node)) { |
@@ -603,7 +603,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) | |||
603 | 603 | ||
604 | /* If we cannot provide an answer the tt_request is | 604 | /* If we cannot provide an answer the tt_request is |
605 | * forwarded */ | 605 | * forwarded */ |
606 | if (!send_tt_response(bat_priv, tt_query)) { | 606 | if (!batadv_send_tt_response(bat_priv, tt_query)) { |
607 | bat_dbg(DBG_TT, bat_priv, | 607 | bat_dbg(DBG_TT, bat_priv, |
608 | "Routing TT_REQUEST to %pM [%c]\n", | 608 | "Routing TT_REQUEST to %pM [%c]\n", |
609 | tt_query->dst, | 609 | tt_query->dst, |
@@ -622,14 +622,14 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) | |||
622 | /* skb_linearize() possibly changed skb->data */ | 622 | /* skb_linearize() possibly changed skb->data */ |
623 | tt_query = (struct tt_query_packet *)skb->data; | 623 | tt_query = (struct tt_query_packet *)skb->data; |
624 | 624 | ||
625 | tt_size = tt_len(ntohs(tt_query->tt_data)); | 625 | tt_size = batadv_tt_len(ntohs(tt_query->tt_data)); |
626 | 626 | ||
627 | /* Ensure we have all the claimed data */ | 627 | /* Ensure we have all the claimed data */ |
628 | if (unlikely(skb_headlen(skb) < | 628 | if (unlikely(skb_headlen(skb) < |
629 | sizeof(struct tt_query_packet) + tt_size)) | 629 | sizeof(struct tt_query_packet) + tt_size)) |
630 | goto out; | 630 | goto out; |
631 | 631 | ||
632 | handle_tt_response(bat_priv, tt_query); | 632 | batadv_handle_tt_response(bat_priv, tt_query); |
633 | } else { | 633 | } else { |
634 | bat_dbg(DBG_TT, bat_priv, | 634 | bat_dbg(DBG_TT, bat_priv, |
635 | "Routing TT_RESPONSE to %pM [%c]\n", | 635 | "Routing TT_RESPONSE to %pM [%c]\n", |
@@ -688,8 +688,9 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if) | |||
688 | "Received ROAMING_ADV from %pM (client %pM)\n", | 688 | "Received ROAMING_ADV from %pM (client %pM)\n", |
689 | roam_adv_packet->src, roam_adv_packet->client); | 689 | roam_adv_packet->src, roam_adv_packet->client); |
690 | 690 | ||
691 | tt_global_add(bat_priv, orig_node, roam_adv_packet->client, | 691 | batadv_tt_global_add(bat_priv, orig_node, roam_adv_packet->client, |
692 | atomic_read(&orig_node->last_ttvn) + 1, true, false); | 692 | atomic_read(&orig_node->last_ttvn) + 1, true, |
693 | false); | ||
693 | 694 | ||
694 | /* Roaming phase starts: I have new information but the ttvn has not | 695 | /* Roaming phase starts: I have new information but the ttvn has not |
695 | * been incremented yet. This flag will make me check all the incoming | 696 | * been incremented yet. This flag will make me check all the incoming |
@@ -934,13 +935,15 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv, | |||
934 | /* we don't have an updated route for this client, so we should | 935 | /* we don't have an updated route for this client, so we should |
935 | * not try to reroute the packet!! | 936 | * not try to reroute the packet!! |
936 | */ | 937 | */ |
937 | if (tt_global_client_is_roaming(bat_priv, ethhdr->h_dest)) | 938 | if (batadv_tt_global_client_is_roaming(bat_priv, |
939 | ethhdr->h_dest)) | ||
938 | return 1; | 940 | return 1; |
939 | 941 | ||
940 | orig_node = transtable_search(bat_priv, NULL, ethhdr->h_dest); | 942 | orig_node = batadv_transtable_search(bat_priv, NULL, |
943 | ethhdr->h_dest); | ||
941 | 944 | ||
942 | if (!orig_node) { | 945 | if (!orig_node) { |
943 | if (!is_my_client(bat_priv, ethhdr->h_dest)) | 946 | if (!batadv_is_my_client(bat_priv, ethhdr->h_dest)) |
944 | return 0; | 947 | return 0; |
945 | primary_if = primary_if_get_selected(bat_priv); | 948 | primary_if = primary_if_get_selected(bat_priv); |
946 | if (!primary_if) | 949 | if (!primary_if) |