Commit 64e01e2812 for strongswan.org
commit 64e01e281207241986a83889973cfe6bf7495435
Author: Tobias Brunner <tobias@strongswan.org>
Date: Mon Jun 1 08:54:49 2026 +0200
charon-cmd: Use %any as local address so IPv4 is not preferred
When resolving the remote host, we first determine if a particular
address family is preferred locally. With `0.0.0.0` that's IPv4, with
`%any` that's not the case. So we use the latter to allow resolvers
to return an IPv6 address.
diff --git a/src/charon-cmd/cmd/cmd_connection.c b/src/charon-cmd/cmd/cmd_connection.c
index 65e522765e..9b19bb45ca 100644
--- a/src/charon-cmd/cmd/cmd_connection.c
+++ b/src/charon-cmd/cmd/cmd_connection.c
@@ -150,7 +150,7 @@ static peer_cfg_t* create_peer_cfg(private_cmd_connection_t *this)
peer_cfg_t *peer_cfg;
proposal_t *proposal;
ike_cfg_create_t ike = {
- .local = "0.0.0.0",
+ .local = "%any",
.remote = this->host,
.remote_port = IKEV2_UDP_PORT,
.fragmentation = FRAGMENTATION_YES,