From b2c20c032ab89e24c8210b1159348e48d917aea2 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 13 May 2018 13:12:43 +0200 Subject: socket: use skb_put_data Signed-off-by: Jason A. Donenfeld --- src/compat/compat.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/compat') diff --git a/src/compat/compat.h b/src/compat/compat.h index d65a538..650b06b 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -577,6 +577,15 @@ struct _____dummy_container { char dev; }; #define genl_dump_check_consistent(a, b) genl_dump_check_consistent(a, b, &genl_family) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && !defined(ISRHEL7) +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 + /* https://lkml.org/lkml/2017/6/23/790 */ #if IS_ENABLED(CONFIG_NF_CONNTRACK) #include -- cgit v1.2.3