]> git.karo-electronics.de Git - linux-beck.git/commitdiff
batman-adv: Prefix send non-static functions with batadv_
authorSven Eckelmann <sven@narfation.org>
Sat, 12 May 2012 00:09:37 +0000 (02:09 +0200)
committerAntonio Quartulli <ordex@autistici.org>
Wed, 20 Jun 2012 20:15:26 +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/bat_iv_ogm.c
net/batman-adv/hard-interface.c
net/batman-adv/icmp_socket.c
net/batman-adv/main.c
net/batman-adv/routing.c
net/batman-adv/send.c
net/batman-adv/send.h
net/batman-adv/soft-interface.c
net/batman-adv/translation-table.c
net/batman-adv/unicast.c
net/batman-adv/vis.c

index f48467ff6713a5463d0ef84d13d0f1227a624e2c..1566eac02d4ca7f7dbabb89647215931bf480f55 100644 (file)
@@ -201,7 +201,7 @@ static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet,
                batadv_inc_counter(bat_priv, BAT_CNT_MGMT_TX);
                batadv_add_counter(bat_priv, BAT_CNT_MGMT_TX_BYTES,
                                   skb->len + ETH_HLEN);
-               send_skb_packet(skb, hard_iface, broadcast_addr);
+               batadv_send_skb_packet(skb, hard_iface, broadcast_addr);
        }
 }
 
@@ -250,8 +250,9 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)
                        forw_packet->if_incoming->net_dev->dev_addr);
 
                /* skb is only used once and than forw_packet is free'd */
-               send_skb_packet(forw_packet->skb, forw_packet->if_incoming,
-                               broadcast_addr);
+               batadv_send_skb_packet(forw_packet->skb,
+                                      forw_packet->if_incoming,
+                                      broadcast_addr);
                forw_packet->skb = NULL;
 
                goto out;
@@ -420,7 +421,7 @@ static void bat_iv_ogm_aggregate_new(const unsigned char *packet_buff,
 
        /* start timer for this packet */
        INIT_DELAYED_WORK(&forw_packet_aggr->delayed_work,
-                         send_outstanding_bat_ogm_packet);
+                         batadv_send_outstanding_bat_ogm_packet);
        queue_delayed_work(bat_event_workqueue,
                           &forw_packet_aggr->delayed_work,
                           send_time - jiffies);
index 1f126cbd2c79d11c9b31efc17db8bd08b88c7bd5..7392ae28114d1e97d88868dd7409125f69f6fedc 100644 (file)
@@ -345,7 +345,7 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
                        hard_iface->net_dev->name);
 
        /* begin scheduling originator messages on that interface */
-       schedule_bat_ogm(hard_iface);
+       batadv_schedule_bat_ogm(hard_iface);
 
 out:
        return 0;
@@ -391,7 +391,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
 
        /* delete all references to this hard_iface */
        batadv_purge_orig_ref(bat_priv);
-       purge_outstanding_packets(bat_priv, hard_iface);
+       batadv_purge_outstanding_packets(bat_priv, hard_iface);
        dev_put(hard_iface->soft_iface);
 
        /* nobody uses this interface anymore */
index 44cbee58720b7f569e4c8ec2fd3b4fce5d9b0117..21c001074ebe616c19fb330f802a98327bd227c3 100644 (file)
@@ -236,7 +236,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
                memcpy(icmp_packet->rr,
                       neigh_node->if_incoming->net_dev->dev_addr, ETH_ALEN);
 
-       send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+       batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
        goto out;
 
 dst_unreach:
index 92f39b50de6ceb16a0826726c2b8b584d92c90c2..b9531a11b7bf8fcb58df545e90000bcff79be819 100644 (file)
@@ -145,7 +145,7 @@ void mesh_free(struct net_device *soft_iface)
 
        atomic_set(&bat_priv->mesh_state, MESH_DEACTIVATING);
 
-       purge_outstanding_packets(bat_priv, NULL);
+       batadv_purge_outstanding_packets(bat_priv, NULL);
 
        vis_quit(bat_priv);
 
index 631b40b65451b5fa1c639f32d364f8466d42c748..d7d05b22cc0db6ee08866d4e7f1c3fb67388633a 100644 (file)
@@ -319,7 +319,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
        icmp_packet->msg_type = ECHO_REPLY;
        icmp_packet->header.ttl = TTL;
 
-       send_skb_packet(skb, router->if_incoming, router->addr);
+       batadv_send_skb_packet(skb, router->if_incoming, router->addr);
        ret = NET_RX_SUCCESS;
 
 out:
@@ -374,7 +374,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
        icmp_packet->msg_type = TTL_EXCEEDED;
        icmp_packet->header.ttl = TTL;
 
-       send_skb_packet(skb, router->if_incoming, router->addr);
+       batadv_send_skb_packet(skb, router->if_incoming, router->addr);
        ret = NET_RX_SUCCESS;
 
 out:
@@ -459,7 +459,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
        icmp_packet->header.ttl--;
 
        /* route it */
-       send_skb_packet(skb, router->if_incoming, router->addr);
+       batadv_send_skb_packet(skb, router->if_incoming, router->addr);
        ret = NET_RX_SUCCESS;
 
 out:
@@ -881,7 +881,7 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
                           skb->len + ETH_HLEN);
 
        /* route it */
-       send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+       batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
        ret = NET_RX_SUCCESS;
 
 out:
@@ -1095,7 +1095,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
                goto out;
 
        /* rebroadcast packet */
-       add_bcast_packet_to_list(bat_priv, skb, 1);
+       batadv_add_bcast_packet_to_list(bat_priv, skb, 1);
 
        /* don't hand the broadcast up if it is from an originator
         * from the same backbone.
index 79f8973810c0b018ec3bfc437ba3aec8ebe12d52..bceb3d72e5c3585fc0e628b7fb78cdb9163dca73 100644 (file)
@@ -33,8 +33,8 @@ static void send_outstanding_bcast_packet(struct work_struct *work);
 
 /* send out an already prepared packet to the given address via the
  * specified batman interface */
-int send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
-                   const uint8_t *dst_addr)
+int batadv_send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
+                          const uint8_t *dst_addr)
 {
        struct ethhdr *ethhdr;
 
@@ -77,7 +77,7 @@ send_skb_err:
        return NET_XMIT_DROP;
 }
 
-void schedule_bat_ogm(struct hard_iface *hard_iface)
+void batadv_schedule_bat_ogm(struct hard_iface *hard_iface)
 {
        struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
 
@@ -133,8 +133,9 @@ static void _add_bcast_packet_to_list(struct bat_priv *bat_priv,
  *
  * The skb is not consumed, so the caller should make sure that the
  * skb is freed. */
-int add_bcast_packet_to_list(struct bat_priv *bat_priv,
-                            const struct sk_buff *skb, unsigned long delay)
+int batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv,
+                                   const struct sk_buff *skb,
+                                   unsigned long delay)
 {
        struct hard_iface *primary_if = NULL;
        struct forw_packet *forw_packet;
@@ -211,7 +212,8 @@ static void send_outstanding_bcast_packet(struct work_struct *work)
                /* send a copy of the saved skb */
                skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC);
                if (skb1)
-                       send_skb_packet(skb1, hard_iface, broadcast_addr);
+                       batadv_send_skb_packet(skb1, hard_iface,
+                                              broadcast_addr);
        }
        rcu_read_unlock();
 
@@ -229,7 +231,7 @@ out:
        atomic_inc(&bat_priv->bcast_queue_left);
 }
 
-void send_outstanding_bat_ogm_packet(struct work_struct *work)
+void batadv_send_outstanding_bat_ogm_packet(struct work_struct *work)
 {
        struct delayed_work *delayed_work =
                container_of(work, struct delayed_work, work);
@@ -253,7 +255,7 @@ void send_outstanding_bat_ogm_packet(struct work_struct *work)
         * shutting down
         */
        if (forw_packet->own)
-               schedule_bat_ogm(forw_packet->if_incoming);
+               batadv_schedule_bat_ogm(forw_packet->if_incoming);
 
 out:
        /* don't count own packet */
@@ -263,8 +265,8 @@ out:
        forw_packet_free(forw_packet);
 }
 
-void purge_outstanding_packets(struct bat_priv *bat_priv,
-                              const struct hard_iface *hard_iface)
+void batadv_purge_outstanding_packets(struct bat_priv *bat_priv,
+                                     const struct hard_iface *hard_iface)
 {
        struct forw_packet *forw_packet;
        struct hlist_node *tmp_node, *safe_tmp_node;
index 824ef06f9b013e9453076fede60faef83a3f1c82..452e8df5abb8560fd43c08a0bfd038c717a22eb9 100644 (file)
 #ifndef _NET_BATMAN_ADV_SEND_H_
 #define _NET_BATMAN_ADV_SEND_H_
 
-int send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
-                   const uint8_t *dst_addr);
-void schedule_bat_ogm(struct hard_iface *hard_iface);
-int add_bcast_packet_to_list(struct bat_priv *bat_priv,
-                            const struct sk_buff *skb, unsigned long delay);
-void send_outstanding_bat_ogm_packet(struct work_struct *work);
-void purge_outstanding_packets(struct bat_priv *bat_priv,
-                              const struct hard_iface *hard_iface);
+int batadv_send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
+                          const uint8_t *dst_addr);
+void batadv_schedule_bat_ogm(struct hard_iface *hard_iface);
+int batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv,
+                                   const struct sk_buff *skb,
+                                   unsigned long delay);
+void batadv_send_outstanding_bat_ogm_packet(struct work_struct *work);
+void batadv_purge_outstanding_packets(struct bat_priv *bat_priv,
+                                     const struct hard_iface *hard_iface);
 
 #endif /* _NET_BATMAN_ADV_SEND_H_ */
index 5bf9a73ae79984ac4e5343d8ff792757989d1945..e15d474bd0b06eacb8e457f4d9c04c016f4a5b6e 100644 (file)
@@ -223,7 +223,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
                bcast_packet->seqno =
                        htonl(atomic_inc_return(&bat_priv->bcast_seqno));
 
-               add_bcast_packet_to_list(bat_priv, skb, 1);
+               batadv_add_bcast_packet_to_list(bat_priv, skb, 1);
 
                /* a copy is stored in the bcast list, therefore removing
                 * the original skb. */
index 3d2c3b142cf1d06d3c7ed0159005a09f380761ec..445dc25ceba119d63f798e0ed75e66c22fa5daca 100644 (file)
@@ -1406,7 +1406,7 @@ static int send_tt_request(struct bat_priv *bat_priv,
 
        batadv_inc_counter(bat_priv, BAT_CNT_TT_REQUEST_TX);
 
-       send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+       batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
        ret = 0;
 
 out:
@@ -1532,7 +1532,7 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
 
        batadv_inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_TX);
 
-       send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+       batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
        ret = true;
        goto out;
 
@@ -1650,7 +1650,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
 
        batadv_inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_TX);
 
-       send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+       batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
        ret = true;
        goto out;
 
@@ -1957,7 +1957,7 @@ static void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
 
        batadv_inc_counter(bat_priv, BAT_CNT_TT_ROAM_ADV_TX);
 
-       send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+       batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
        ret = 0;
 
 out:
index 894c6a416dac0b1b9b5bb53aa3d8b090a529214e..6bb3bb9f843fffceaf4d4148cd876fb8519c9b23 100644 (file)
@@ -268,8 +268,8 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
        frag1->seqno = htons(seqno - 1);
        frag2->seqno = htons(seqno);
 
-       send_skb_packet(skb, hard_iface, dstaddr);
-       send_skb_packet(frag_skb, hard_iface, dstaddr);
+       batadv_send_skb_packet(skb, hard_iface, dstaddr);
+       batadv_send_skb_packet(frag_skb, hard_iface, dstaddr);
        ret = NET_RX_SUCCESS;
        goto out;
 
@@ -348,7 +348,7 @@ find_router:
                goto out;
        }
 
-       send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+       batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
        ret = 0;
        goto out;
 
index 1972a11aace162f9caddd158257528ec10865b21..c56737cba0e2144d96af1610667e787b279319c5 100644 (file)
@@ -777,7 +777,8 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
 
                        skb = skb_clone(info->skb_packet, GFP_ATOMIC);
                        if (skb)
-                               send_skb_packet(skb, hard_iface, dstaddr);
+                               batadv_send_skb_packet(skb, hard_iface,
+                                                      dstaddr);
 
                }
                rcu_read_unlock();
@@ -804,7 +805,7 @@ static void unicast_vis_packet(struct bat_priv *bat_priv,
 
        skb = skb_clone(info->skb_packet, GFP_ATOMIC);
        if (skb)
-               send_skb_packet(skb, router->if_incoming, router->addr);
+               batadv_send_skb_packet(skb, router->if_incoming, router->addr);
 
 out:
        if (router)