diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-08-02 21:07:25 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-08-02 21:09:22 +0200 |
commit | 28bf99e90ae8f7c9d28e2189fdd7d83e94750dc4 (patch) | |
tree | 6007f65f0baf2e249e1044f959397cc8baf19ffd | |
parent | routingtable: unbloat BUG() (diff) | |
download | wireguard-monolithic-historical-28bf99e90ae8f7c9d28e2189fdd7d83e94750dc4.tar.xz wireguard-monolithic-historical-28bf99e90ae8f7c9d28e2189fdd7d83e94750dc4.zip |
tools: stricter userspace ipc parsing
Diffstat (limited to '')
-rw-r--r-- | src/tools/ipc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/ipc.c b/src/tools/ipc.c index ed5fbc2..48d06aa 100644 --- a/src/tools/ipc.c +++ b/src/tools/ipc.c @@ -314,13 +314,13 @@ static int userspace_get_device(struct wgdevice **out, const char *interface) break; *value++ = key[--line_len] = '\0'; - if (!strcmp(key, "private_key")) { + if (!peer && !strcmp(key, "private_key")) { if (!key_from_hex(dev->private_key, value)) break; curve25519_generate_public(dev->public_key, dev->private_key); - } else if (!strcmp(key, "listen_port")) + } else if (!peer && !strcmp(key, "listen_port")) dev->port = NUM(0xffffU); - else if (!strcmp(key, "fwmark")) + else if (!peer && !strcmp(key, "fwmark")) dev->fwmark = NUM(0xffffffffU); else if (!strcmp(key, "public_key")) { peer = ADD(sizeof(struct wgpeer)); |