summaryrefslogtreecommitdiff
path: root/proto/wireguard/wireguard.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto/wireguard/wireguard.c')
-rw-r--r--proto/wireguard/wireguard.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/proto/wireguard/wireguard.c b/proto/wireguard/wireguard.c
index 442aabfb..da80d9f7 100644
--- a/proto/wireguard/wireguard.c
+++ b/proto/wireguard/wireguard.c
@@ -67,9 +67,10 @@ int get_device(struct wg_proto *p, wg_device **pdev, const char *device_name)
}
peer->next_peer = NULL;
- sockaddr_fill((sockaddr*)&peer->endpoint.addr,
- ipa_is_ip4(pc->endpoint) ? AF_INET : AF_INET6,
- pc->endpoint, NULL, pc->remote_port);
+ if (!ip6_equal(pc->endpoint, IPA_NONE))
+ sockaddr_fill((sockaddr*)&peer->endpoint.addr,
+ ipa_is_ip4(pc->endpoint) ? AF_INET : AF_INET6,
+ pc->endpoint, NULL, pc->remote_port);
wg_allowedip *allowedip = calloc(1, sizeof(wg_allowedip));
peer->first_allowedip = allowedip;