diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-05-13 17:34:23 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2024-07-05 17:07:16 +0200 |
commit | 19ca80c07efa6fb9f519bec136def7b04e96363d (patch) | |
tree | a97c74bb1812becfe2efdfa199b298cd21fe6d2e | |
parent | caf25d292d73dd340a0e02ef7e417e56cb7fd809 (diff) |
Wg-user: Work-around listen_port mutex dead lock
Problem with listen_port dead lock in wireguard-go.
-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 ff9a97f4..8ba7c4f8 100644 --- a/sysdep/unix/wg_user.c +++ b/sysdep/unix/wg_user.c @@ -212,8 +212,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 if (dev->flags & WGDEVICE_REPLACE_PEERS) wg_put_bool("replace_peers", true, buf, size); |