]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
batman-adv: Prefix unicast non-static functions with batadv_
authorSven Eckelmann <sven@narfation.org>
Sat, 12 May 2012 00:09:40 +0000 (02:09 +0200)
committerAntonio Quartulli <ordex@autistici.org>
Wed, 20 Jun 2012 20:15:30 +0000 (22:15 +0200)
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>
net/batman-adv/originator.c
net/batman-adv/routing.c
net/batman-adv/soft-interface.c
net/batman-adv/unicast.c
net/batman-adv/unicast.h

index 030666c12daf117e6cfb98f425be6d972cdba393..9d77edeff589ff7ac2ef7758b41bfec076b64141 100644 (file)
@@ -138,7 +138,7 @@ static void orig_node_free_rcu(struct rcu_head *rcu)
 
        spin_unlock_bh(&orig_node->neigh_list_lock);
 
-       frag_list_free(&orig_node->frag_list);
+       batadv_frag_list_free(&orig_node->frag_list);
        batadv_tt_global_del_orig(orig_node->bat_priv, orig_node,
                                  "originator timed out");
 
@@ -372,7 +372,7 @@ static void _purge_orig(struct bat_priv *bat_priv)
 
                        if (has_timed_out(orig_node->last_frag_packet,
                                          FRAG_TIMEOUT))
-                               frag_list_free(&orig_node->frag_list);
+                               batadv_frag_list_free(&orig_node->frag_list);
                }
                spin_unlock_bh(list_lock);
        }
index 8fb5ae3dee87fbd24e4dcfc606e70912b4970fa8..4103f68ae9db7cec7724a488fa804fef8fd4e846 100644 (file)
@@ -850,15 +850,16 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
        if (unicast_packet->header.packet_type == BAT_UNICAST &&
            atomic_read(&bat_priv->fragmentation) &&
            skb->len > neigh_node->if_incoming->net_dev->mtu) {
-               ret = frag_send_skb(skb, bat_priv,
-                                   neigh_node->if_incoming, neigh_node->addr);
+               ret = batadv_frag_send_skb(skb, bat_priv,
+                                          neigh_node->if_incoming,
+                                          neigh_node->addr);
                goto out;
        }
 
        if (unicast_packet->header.packet_type == BAT_UNICAST_FRAG &&
            frag_can_reassemble(skb, neigh_node->if_incoming->net_dev->mtu)) {
 
-               ret = frag_reassemble_skb(skb, bat_priv, &new_skb);
+               ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb);
 
                if (ret == NET_RX_DROP)
                        goto out;
@@ -1013,7 +1014,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
        /* packet for me */
        if (is_my_mac(unicast_packet->dest)) {
 
-               ret = frag_reassemble_skb(skb, bat_priv, &new_skb);
+               ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb);
 
                if (ret == NET_RX_DROP)
                        return NET_RX_DROP;
index a4b5e64bf0c73f135f279181e90241bd7cfa545a..9fd1925775c73b37e4f6ffa91ccdc46bce9e5e1c 100644 (file)
@@ -237,7 +237,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
                                goto dropped;
                }
 
-               ret = unicast_send_skb(skb, bat_priv);
+               ret = batadv_unicast_send_skb(skb, bat_priv);
                if (ret != 0)
                        goto dropped_freed;
        }
index 5e699db700b3ac8fa4f760a797f9ea49c2aacb28..e9d3bdd4e3d62b7967a29fb059d04ae7b861bec3 100644 (file)
@@ -101,7 +101,7 @@ static int frag_create_buffer(struct list_head *head)
        for (i = 0; i < FRAG_BUFFER_SIZE; i++) {
                tfp = kmalloc(sizeof(*tfp), GFP_ATOMIC);
                if (!tfp) {
-                       frag_list_free(head);
+                       batadv_frag_list_free(head);
                        return -ENOMEM;
                }
                tfp->skb = NULL;
@@ -151,7 +151,7 @@ mov_tail:
        return NULL;
 }
 
-void frag_list_free(struct list_head *head)
+void batadv_frag_list_free(struct list_head *head)
 {
        struct frag_packet_list_entry *pf, *tmp_pf;
 
@@ -172,8 +172,8 @@ void frag_list_free(struct list_head *head)
  * or the skb could be reassembled (skb_new will point to the new packet and
  * skb was freed)
  */
-int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
-                       struct sk_buff **new_skb)
+int batadv_frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
+                              struct sk_buff **new_skb)
 {
        struct orig_node *orig_node;
        struct frag_packet_list_entry *tmp_frag_entry;
@@ -216,8 +216,8 @@ out:
        return ret;
 }
 
-int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
-                 struct hard_iface *hard_iface, const uint8_t dstaddr[])
+int batadv_frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
+                        struct hard_iface *hard_iface, const uint8_t dstaddr[])
 {
        struct unicast_packet tmp_uc, *unicast_packet;
        struct hard_iface *primary_if;
@@ -283,7 +283,7 @@ out:
        return ret;
 }
 
-int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv)
+int batadv_unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv)
 {
        struct ethhdr *ethhdr = (struct ethhdr *)skb->data;
        struct unicast_packet *unicast_packet;
@@ -342,8 +342,9 @@ find_router:
                                neigh_node->if_incoming->net_dev->mtu) {
                /* send frag skb decreases ttl */
                unicast_packet->header.ttl++;
-               ret = frag_send_skb(skb, bat_priv,
-                                   neigh_node->if_incoming, neigh_node->addr);
+               ret = batadv_frag_send_skb(skb, bat_priv,
+                                          neigh_node->if_incoming,
+                                          neigh_node->addr);
                goto out;
        }
 
index a9faf6b1db197e1842a894585b1be8805ab815a9..657fe7392b14885f2946b8af78577a793d516ffa 100644 (file)
 #define FRAG_TIMEOUT 10000     /* purge frag list entries after time in ms */
 #define FRAG_BUFFER_SIZE 6     /* number of list elements in buffer */
 
-int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
-                       struct sk_buff **new_skb);
-void frag_list_free(struct list_head *head);
-int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv);
-int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
-                 struct hard_iface *hard_iface, const uint8_t dstaddr[]);
+int batadv_frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
+                              struct sk_buff **new_skb);
+void batadv_frag_list_free(struct list_head *head);
+int batadv_unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv);
+int batadv_frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
+                        struct hard_iface *hard_iface,
+                        const uint8_t dstaddr[]);
 
 static inline int frag_can_reassemble(const struct sk_buff *skb, int mtu)
 {