Skip to contentSkip to conversation

batman-adv: move misplaced compat code

PATCH Applied Antonio Quartulli 2 participants 2 messages Oct 19, 2014 – Dec 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: move misplaced compat code

consume_skb() has to be re-defined only for kernels <2.6.30 but the macro was accidentally placed right above any #ifdef block causing the function to be always redefined.

Fix this by moving the macro to the proper #ifdef block.

Introduced by: 15fb0fab51a3695738f65dfaab045e979fc89dce ("batman-adv add compat code for consume_skb")

---
 compat.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
compat.h +2 -2
index ed5b815..8de2010 100644
@@ -23,10 +23,10 @@
 
 #include <linux/version.h>	/* LINUX_VERSION_CODE */
 
-#define consume_skb(_skb) kfree_skb(_skb)
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
 
+#define consume_skb(_skb) kfree_skb(_skb)
+
 #undef __alloc_percpu
 #define __alloc_percpu(size, align) \
 	percpu_alloc_mask((size), GFP_KERNEL, cpu_possible_map)
Signature · 1 line
2.0.4
#1 lore raw
Quoted 6 lines · On Sunday 19 October 2014 19:59:41 Antonio Quartulli wrote:

consume_skb() has to be re-defined only for kernels <2.6.30 but the macro was accidentally placed right above any #ifdef block causing the function to be always redefined.

Fix this by moving the macro to the proper #ifdef block.

Quoted 8 lines

Introduced by: 15fb0fab51a3695738f65dfaab045e979fc89dce ("batman-adv add compat code for consume_skb")

---
 compat.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied in revision b609f26.

Thanks,
Marek