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 | bc9494f8b68fc138ba6bc303ca90cee1b33e3ea9 (patch) | |
tree | 5d3d570a0a3cb0de790ea054f4f8972bb94e1df8 /src/ipc.c | |
parent | contrib: move Android tools to wireguard-android repo (diff) | |
download | wireguard-tools-bc9494f8b68fc138ba6bc303ca90cee1b33e3ea9.tar.xz wireguard-tools-bc9494f8b68fc138ba6bc303ca90cee1b33e3ea9.zip |
wg: stricter userspace ipc parsing
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | src/ipc.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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)); |