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 --- Corrected declaration of batadv_free_rcu_*
compat.c | 8 ++++---- compat.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/compat.c b/compat.c index 35ad397..702c7c1 100644 --- a/compat.c +++ b/compat.c @@ -28,7 +28,7 @@
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
-void free_rcu_gw_node(struct rcu_head *rcu) +void batadv_free_rcu_gw_node(struct rcu_head *rcu) { struct gw_node *gw_node;
@@ -36,7 +36,7 @@ void free_rcu_gw_node(struct rcu_head *rcu) kfree(gw_node); }
-void free_rcu_neigh_node(struct rcu_head *rcu) +void batadv_free_rcu_neigh_node(struct rcu_head *rcu) { struct neigh_node *neigh_node;
@@ -44,7 +44,7 @@ void free_rcu_neigh_node(struct rcu_head *rcu) kfree(neigh_node); }
-void free_rcu_tt_local_entry(struct rcu_head *rcu) +void batadv_free_rcu_tt_local_entry(struct rcu_head *rcu) { struct tt_common_entry *tt_common_entry; struct tt_local_entry *tt_local_entry; @@ -56,7 +56,7 @@ void free_rcu_tt_local_entry(struct rcu_head *rcu) }
#ifdef CONFIG_BATMAN_ADV_BLA -void free_rcu_backbone_gw(struct rcu_head *rcu) +void batadv_free_rcu_backbone_gw(struct rcu_head *rcu) { struct backbone_gw *backbone_gw;
diff --git a/compat.h b/compat.h index 33c52d3..13ca624 100644 --- a/compat.h +++ b/compat.h @@ -138,13 +138,13 @@ static inline int __param_set_copystring(const char *val,
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
-#define kfree_rcu(ptr, rcu_head) call_rcu(&ptr->rcu_head, free_rcu_##ptr) +#define kfree_rcu(ptr, rcu_head) call_rcu(&ptr->rcu_head, batadv_free_rcu_##ptr) #define vlan_insert_tag(skb, vid) __vlan_put_tag(skb, vid)
-void free_rcu_gw_node(struct rcu_head *rcu); -void free_rcu_neigh_node(struct rcu_head *rcu); -void free_rcu_tt_local_entry(struct rcu_head *rcu); -void free_rcu_backbone_gw(struct rcu_head *rcu); +void batadv_free_rcu_gw_node(struct rcu_head *rcu); +void batadv_free_rcu_neigh_node(struct rcu_head *rcu); +void batadv_free_rcu_tt_local_entry(struct rcu_head *rcu); +void batadv_free_rcu_backbone_gw(struct rcu_head *rcu);
#endif /* < KERNEL_VERSION(3, 0, 0) */