diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-11 20:09:42 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-20 16:15:32 -0400 |
commit | 3193e8fdfa355289892661d206d1954114a7be95 (patch) | |
tree | 4fce7c85cd572389433a128db0ed180a3928e968 /net/batman-adv/routing.c | |
parent | d0f714f472967577067853acc8dabe0abc75ae8f (diff) |
batman-adv: Prefix main 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 | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index d492634dd040..1b1dd41f5fe6 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -419,7 +419,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
419 | goto out; | 419 | goto out; |
420 | 420 | ||
421 | /* not for me */ | 421 | /* not for me */ |
422 | if (!is_my_mac(ethhdr->h_dest)) | 422 | if (!batadv_is_my_mac(ethhdr->h_dest)) |
423 | goto out; | 423 | goto out; |
424 | 424 | ||
425 | icmp_packet = (struct icmp_packet_rr *)skb->data; | 425 | icmp_packet = (struct icmp_packet_rr *)skb->data; |
@@ -433,7 +433,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
433 | } | 433 | } |
434 | 434 | ||
435 | /* packet for me */ | 435 | /* packet for me */ |
436 | if (is_my_mac(icmp_packet->dst)) | 436 | if (batadv_is_my_mac(icmp_packet->dst)) |
437 | return recv_my_icmp_packet(bat_priv, skb, hdr_size); | 437 | return recv_my_icmp_packet(bat_priv, skb, hdr_size); |
438 | 438 | ||
439 | /* TTL exceeded */ | 439 | /* TTL exceeded */ |
@@ -614,7 +614,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) | |||
614 | case TT_RESPONSE: | 614 | case TT_RESPONSE: |
615 | batadv_inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_RX); | 615 | batadv_inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_RX); |
616 | 616 | ||
617 | if (is_my_mac(tt_query->dst)) { | 617 | if (batadv_is_my_mac(tt_query->dst)) { |
618 | /* packet needs to be linearized to access the TT | 618 | /* packet needs to be linearized to access the TT |
619 | * changes */ | 619 | * changes */ |
620 | if (skb_linearize(skb) < 0) | 620 | if (skb_linearize(skb) < 0) |
@@ -670,7 +670,7 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if) | |||
670 | 670 | ||
671 | roam_adv_packet = (struct roam_adv_packet *)skb->data; | 671 | roam_adv_packet = (struct roam_adv_packet *)skb->data; |
672 | 672 | ||
673 | if (!is_my_mac(roam_adv_packet->dst)) | 673 | if (!batadv_is_my_mac(roam_adv_packet->dst)) |
674 | return route_unicast_packet(skb, recv_if); | 674 | return route_unicast_packet(skb, recv_if); |
675 | 675 | ||
676 | /* check if it is a backbone gateway. we don't accept | 676 | /* check if it is a backbone gateway. we don't accept |
@@ -804,7 +804,7 @@ static int check_unicast_packet(struct sk_buff *skb, int hdr_size) | |||
804 | return -1; | 804 | return -1; |
805 | 805 | ||
806 | /* not for me */ | 806 | /* not for me */ |
807 | if (!is_my_mac(ethhdr->h_dest)) | 807 | if (!batadv_is_my_mac(ethhdr->h_dest)) |
808 | return -1; | 808 | return -1; |
809 | 809 | ||
810 | return 0; | 810 | return 0; |
@@ -909,7 +909,7 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv, | |||
909 | 909 | ||
910 | unicast_packet = (struct unicast_packet *)skb->data; | 910 | unicast_packet = (struct unicast_packet *)skb->data; |
911 | 911 | ||
912 | if (is_my_mac(unicast_packet->dest)) { | 912 | if (batadv_is_my_mac(unicast_packet->dest)) { |
913 | tt_poss_change = bat_priv->tt_poss_change; | 913 | tt_poss_change = bat_priv->tt_poss_change; |
914 | curr_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn); | 914 | curr_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn); |
915 | } else { | 915 | } else { |
@@ -985,7 +985,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
985 | unicast_packet = (struct unicast_packet *)skb->data; | 985 | unicast_packet = (struct unicast_packet *)skb->data; |
986 | 986 | ||
987 | /* packet for me */ | 987 | /* packet for me */ |
988 | if (is_my_mac(unicast_packet->dest)) { | 988 | if (batadv_is_my_mac(unicast_packet->dest)) { |
989 | batadv_interface_rx(recv_if->soft_iface, skb, recv_if, | 989 | batadv_interface_rx(recv_if->soft_iface, skb, recv_if, |
990 | hdr_size); | 990 | hdr_size); |
991 | return NET_RX_SUCCESS; | 991 | return NET_RX_SUCCESS; |
@@ -1012,7 +1012,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb, | |||
1012 | unicast_packet = (struct unicast_frag_packet *)skb->data; | 1012 | unicast_packet = (struct unicast_frag_packet *)skb->data; |
1013 | 1013 | ||
1014 | /* packet for me */ | 1014 | /* packet for me */ |
1015 | if (is_my_mac(unicast_packet->dest)) { | 1015 | if (batadv_is_my_mac(unicast_packet->dest)) { |
1016 | 1016 | ||
1017 | ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb); | 1017 | ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb); |
1018 | 1018 | ||
@@ -1057,13 +1057,13 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1057 | goto out; | 1057 | goto out; |
1058 | 1058 | ||
1059 | /* ignore broadcasts sent by myself */ | 1059 | /* ignore broadcasts sent by myself */ |
1060 | if (is_my_mac(ethhdr->h_source)) | 1060 | if (batadv_is_my_mac(ethhdr->h_source)) |
1061 | goto out; | 1061 | goto out; |
1062 | 1062 | ||
1063 | bcast_packet = (struct bcast_packet *)skb->data; | 1063 | bcast_packet = (struct bcast_packet *)skb->data; |
1064 | 1064 | ||
1065 | /* ignore broadcasts originated by myself */ | 1065 | /* ignore broadcasts originated by myself */ |
1066 | if (is_my_mac(bcast_packet->orig)) | 1066 | if (batadv_is_my_mac(bcast_packet->orig)) |
1067 | goto out; | 1067 | goto out; |
1068 | 1068 | ||
1069 | if (bcast_packet->header.ttl < 2) | 1069 | if (bcast_packet->header.ttl < 2) |
@@ -1139,14 +1139,14 @@ int batadv_recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1139 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 1139 | ethhdr = (struct ethhdr *)skb_mac_header(skb); |
1140 | 1140 | ||
1141 | /* not for me */ | 1141 | /* not for me */ |
1142 | if (!is_my_mac(ethhdr->h_dest)) | 1142 | if (!batadv_is_my_mac(ethhdr->h_dest)) |
1143 | return NET_RX_DROP; | 1143 | return NET_RX_DROP; |
1144 | 1144 | ||
1145 | /* ignore own packets */ | 1145 | /* ignore own packets */ |
1146 | if (is_my_mac(vis_packet->vis_orig)) | 1146 | if (batadv_is_my_mac(vis_packet->vis_orig)) |
1147 | return NET_RX_DROP; | 1147 | return NET_RX_DROP; |
1148 | 1148 | ||
1149 | if (is_my_mac(vis_packet->sender_orig)) | 1149 | if (batadv_is_my_mac(vis_packet->sender_orig)) |
1150 | return NET_RX_DROP; | 1150 | return NET_RX_DROP; |
1151 | 1151 | ||
1152 | switch (vis_packet->vis_type) { | 1152 | switch (vis_packet->vis_type) { |