From 64576f9a062516ff29a6186bac7527d55e29d258 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 11 Jan 2020 12:16:13 -0500 Subject: [PATCH] netlink: make sure to clear return value when trying again Otherwise this runs in an infinite loop if at some point a dump was interrupted. Signed-off-by: Jason A. Donenfeld --- src/ipc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ipc.c b/src/ipc.c index 1110670..8b74b5c 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -881,11 +881,12 @@ static void coalesce_peers(struct wgdevice *device) static int kernel_get_device(struct wgdevice **device, const char *iface) { - int ret = 0; + int ret; struct nlmsghdr *nlh; struct mnlg_socket *nlg; try_again: + ret = 0; *device = calloc(1, sizeof(**device)); if (!*device) return -errno;