diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-05 22:59:40 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-05 22:59:40 +0200 |
commit | 1dd83eb7d4546c17eecb14a5f52b34d908ee1581 (patch) | |
tree | 8563e38d4ab8d5f2e3fed9eb4944e897b8bfeebb /src/compat | |
parent | b8f77e5caf1de21a7ea3b1e5eca57dfa7f5a8bfe (diff) |
compat: macro rewrite netlink instead of cluttering
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat')
-rw-r--r-- | src/compat/compat.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index b422c6d..c75bfe3 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -440,6 +440,19 @@ static inline struct nlattr **genl_family_attrbuf(const struct genl_family *fami #endif #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) +#define get_device_dump(a, b) get_device_dump_real(a, b); \ +static int get_device_dump(a, b) { \ + struct wireguard_device *wg = (struct wireguard_device *)cb->args[0]; \ + if (!wg) { \ + int ret = get_device_start(cb); \ + if (ret) \ + return ret; \ + } \ + return get_device_dump_real(skb, cb); \ +} \ +static int get_device_dump_real(a, b) +#endif /* https://lkml.org/lkml/2017/6/23/790 */ #if IS_ENABLED(CONFIG_NF_CONNTRACK) |