diff options
-rw-r--r-- | sysdep/unix/wg_user.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdep/unix/wg_user.c b/sysdep/unix/wg_user.c index 73ca0e20..a929b989 100644 --- a/sysdep/unix/wg_user.c +++ b/sysdep/unix/wg_user.c @@ -225,14 +225,16 @@ user_put_device(wg_device *dev, byte **buf, uint *size) 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); + if (dev->flags & WGDEVICE_REPLACE_PEERS) + wg_put_bool("replace_peers", true, buf, size); wg_peer *peer = NULL; wg_for_each_peer(dev, peer) { wg_put_key("public_key", peer->public_key, buf, size); wg_put_endpoint(&peer->endpoint, buf, size); - wg_put_bool("replace_allowed_ips", peer->flags & WGPEER_REPLACE_ALLOWEDIPS, buf, size); + if (peer->flags & WGPEER_REPLACE_ALLOWEDIPS) + wg_put_bool("replace_allowed_ips", true, buf, size); wg_allowedip *allowedip = NULL; wg_for_each_allowedip(peer, allowedip) |