aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat/compat.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-13 13:12:43 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-13 16:58:53 +0200
commit926caae6dab68183b93198f644c19cef2f1dc8eb (patch)
tree0a3e7d50954474baa33d4d54cbe156a2d3bf323e /src/compat/compat.h
parentwg-quick: preliminary support for go implementation (diff)
downloadwireguard-monolithic-historical-926caae6dab68183b93198f644c19cef2f1dc8eb.tar.xz
wireguard-monolithic-historical-926caae6dab68183b93198f644c19cef2f1dc8eb.zip
socket: use skb_put_data
Diffstat (limited to '')
-rw-r--r--src/compat/compat.h9
1 files changed, 9 insertions, 0 deletions
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 <linux/ip.h>