]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
wg: fix removal of psk
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 23 Aug 2017 18:51:52 +0000 (12:51 -0600)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 23 Aug 2017 18:51:52 +0000 (12:51 -0600)
This is an attribute of the peer, not the device.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/config.c

index 5bb985f7d362ce3304d012c2a4d7fc8b3bdaf2c9..2f61d5b2e75f76a8694d126b6a9026486e4e5675 100644 (file)
@@ -556,7 +556,7 @@ bool config_read_cmd(struct wgdevice **device, char *argv[], int argc)
                                if (!parse_key(peer_from_offset(buf.dev, peer_offset)->preshared_key, key_line))
                                        goto error;
                        } else if (ret == 1)
-                               buf.dev->flags |= WGPEER_REMOVE_PRESHARED_KEY;
+                               peer_from_offset(buf.dev, peer_offset)->flags |= WGPEER_REMOVE_PRESHARED_KEY;
                        else
                                goto error;
                        argv += 2;