diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-05-13 17:34:23 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-09-13 18:06:16 +0200 |
commit | 93d5f6c27a0b0f87a9130f381178aad89cba2d2e (patch) | |
tree | 9d1828defbbef20968f561eba257e3b87ff56e43 /sysdep | |
parent | 7f154ef28dba44884bffded9499f1d9016bb09f9 (diff) |
work-around problem with listen_port mutex dead lock
Diffstat (limited to 'sysdep')
-rw-r--r-- | sysdep/unix/wg_user.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdep/unix/wg_user.c b/sysdep/unix/wg_user.c index 5d4d59a0..df46ffef 100644 --- a/sysdep/unix/wg_user.c +++ b/sysdep/unix/wg_user.c @@ -193,8 +193,13 @@ static int user_put_device(wg_device *dev, byte **buf, uint *size) { wg_put_u16("set", 1, buf, size); - wg_put_key("private_key", dev->private_key, buf, size); - wg_put_u16("listen_port", dev->listen_port, buf, size); + if (dev->flags & WGDEVICE_HAS_PRIVATE_KEY) + wg_put_key("private_key", dev->private_key, buf, size); +#if 0 + /* Setting listen_port causes dead-lock in wireguard-go. */ + if (dev->flags & WGDEVICE_HAS_LISTEN_PORT) + wg_put_u16("listen_port", dev->listen_port, buf, size); +#endif wg_put_bool("replace_peers", dev->flags & WGDEVICE_REPLACE_PEERS, buf, size); wg_peer *peer = NULL; |