diff options
-rw-r--r-- | src/compat/compat.h | 6 | ||||
-rw-r--r-- | src/netlink.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index fa155d5..16e7923 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -38,6 +38,7 @@ #define __ro_after_init __read_mostly #endif +#include <linux/compiler.h> #ifndef READ_ONCE #define READ_ONCE ACCESS_ONCE #endif @@ -541,6 +542,11 @@ struct _____dummy_container { char dev; }; #define getnstimeofday64 getnstimeofday #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) +#include <net/genetlink.h> +#define genl_dump_check_consistent(a, b) genl_dump_check_consistent(a, b, &genl_family) +#endif + /* https://lkml.org/lkml/2017/6/23/790 */ #if IS_ENABLED(CONFIG_NF_CONNTRACK) #include <linux/ip.h> diff --git a/src/netlink.c b/src/netlink.c index 7fa243e..43e5ce0 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -177,7 +177,7 @@ static int get_device_dump(struct sk_buff *skb, struct netlink_callback *cb) hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, &genl_family, NLM_F_MULTI, WG_CMD_GET_DEVICE); if (!hdr) goto out; - genl_dump_check_consistent(cb, hdr, &genl_family); + genl_dump_check_consistent(cb, hdr); if (!last_peer_cursor) { if (nla_put_u16(skb, WGDEVICE_A_LISTEN_PORT, wg->incoming_port) || nla_put_u32(skb, WGDEVICE_A_FWMARK, wg->fwmark) || nla_put_u32(skb, WGDEVICE_A_IFINDEX, wg->dev->ifindex) || nla_put_string(skb, WGDEVICE_A_IFNAME, wg->dev->name)) |