summaryrefslogtreecommitdiff
path: root/batman-adv/files/compat-hacks.h
diff options
context:
space:
mode:
Diffstat (limited to 'batman-adv/files/compat-hacks.h')
-rw-r--r--batman-adv/files/compat-hacks.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/batman-adv/files/compat-hacks.h b/batman-adv/files/compat-hacks.h
index ea7200c..1f1bdc2 100644
--- a/batman-adv/files/compat-hacks.h
+++ b/batman-adv/files/compat-hacks.h
@@ -192,6 +192,35 @@ static inline int batadv_nla_put_u64_64bit(struct sk_buff *skb, int attrtype,
#endif /* < KERNEL_VERSION(4, 7, 0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
+
+static inline void *batadv_skb_put(struct sk_buff *skb, unsigned int len)
+{
+ return (void *)skb_put(skb, len);
+}
+#define skb_put batadv_skb_put
+
+static inline void *skb_put_zero(struct sk_buff *skb, unsigned int len)
+{
+ void *tmp = skb_put(skb, len);
+
+ memset(tmp, 0, len);
+
+ return tmp;
+}
+
+static inline void *skb_put_data(struct sk_buff *skb, const void *data,
+ unsigned int len)
+{
+ void *tmp = skb_put(skb, len);
+
+ memcpy(tmp, data, len);
+
+ return tmp;
+}
+
+#endif /* < KERNEL_VERSION(4, 13, 0) */
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)