summaryrefslogtreecommitdiffhomepage
path: root/src/netlink.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-11-27 12:18:52 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-12-05 11:51:39 +0100
commit87e48ccfbfb99a849daade12cb7f192edf8eced8 (patch)
treeae49e23e98de673f985f0a3a64cb9853c7248e31 /src/netlink.c
parent23bceb259a4fc28ce61a25cf0a35a1794d4c28de (diff)
netlink: prepare for removal of genl_family_attrbuf in 5.5
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/netlink.c')
-rw-r--r--src/netlink.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/netlink.c b/src/netlink.c
index 190e405..9bf2f84 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -94,8 +94,8 @@ static int get_allowedips(struct sk_buff *skb, const u8 *ip, u8 cidr,
struct dump_ctx {
struct wg_device *wg;
struct wg_peer *next_peer;
- struct allowedips_node *next_allowedip;
u64 allowedips_seq;
+ struct allowedips_node *next_allowedip;
};
#define DUMP_CTX(cb) ((struct dump_ctx *)(cb)->args)
@@ -196,15 +196,9 @@ err:
static int wg_get_device_start(struct netlink_callback *cb)
{
- struct nlattr **attrs = genl_family_attrbuf(&genl_family);
struct wg_device *wg;
- int ret;
- ret = nlmsg_parse(cb->nlh, GENL_HDRLEN + genl_family.hdrsize, attrs,
- genl_family.maxattr, device_policy, NULL);
- if (ret < 0)
- return ret;
- wg = lookup_interface(attrs, cb->skb);
+ wg = lookup_interface(genl_dumpit_info(cb)->attrs, cb->skb);
if (IS_ERR(wg))
return PTR_ERR(wg);
DUMP_CTX(cb)->wg = wg;