summaryrefslogtreecommitdiffhomepage
path: root/src/config.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-12-20 04:21:15 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-12-23 21:09:23 +0100
commitceed7e873e84eb61265fe50f253581160122a203 (patch)
tree800416cbb12f2ed1e30a0532e20b591b583aa5ee /src/config.c
parent0cea09ab486db506ce7d3b786c51e2f6d162293c (diff)
config: allow removing multiple peers at once
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c3
1 files changed, 2 insertions, 1 deletions
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));