[3/9] batman-adv: Provide skb_cow_head on kernels prior 2.6.23

Message ID 1281820085-13507-3-git-send-email-sven.eckelmann@gmx.de (mailing list archive)
State Accepted, archived
Headers

Commit Message

Sven Eckelmann Aug. 14, 2010, 9:07 p.m. UTC
  skb_cow_head was first introduced in v2.6.23-rc6-155-gd9cc204 and we
must use skb_cow on those kernel which will also copy the skb when it
shares data with other skbs and not only when the header is only shared.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 batman-adv/compat.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
  

Patch

diff --git a/batman-adv/compat.h b/batman-adv/compat.h
index f0f0b16..5bf1532 100644
--- a/batman-adv/compat.h
+++ b/batman-adv/compat.h
@@ -70,6 +70,11 @@  static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len)
 	return 0;
 }
 
+static inline int skb_cow_head(struct sk_buff *skb, unsigned int headroom)
+{
+	return skb_cow(skb, headroom);
+}
+
 #define cancel_delayed_work_sync(wq) cancel_delayed_work(wq)
 
 #endif /* < KERNEL_VERSION(2, 6, 23) */