From ceed7e873e84eb61265fe50f253581160122a203 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 20 Dec 2016 04:21:15 +0100 Subject: config: allow removing multiple peers at once Signed-off-by: Jason A. Donenfeld --- src/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index 4972245..741cace 100644 --- a/src/config.c +++ b/src/config.c @@ -71,7 +71,7 @@ static int set_peer(struct wireguard_device *wg, void __user *user_peer, size_t if (in_peer.remove_me) { peer_put(peer); peer_remove(peer); - return 0; + goto out; } if (in_peer.endpoint.ss_family == AF_INET || in_peer.endpoint.ss_family == AF_INET6) { @@ -103,6 +103,7 @@ static int set_peer(struct wireguard_device *wg, void __user *user_peer, size_t peer_put(peer); +out: if (!ret) *len = sizeof(struct wgpeer) + (in_peer.num_ipmasks * sizeof(struct wgipmask)); -- cgit v1.2.3