From 64e01e281207241986a83889973cfe6bf7495435 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 1 Jun 2026 08:54:49 +0200 Subject: [PATCH] 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. --- src/charon-cmd/cmd/cmd_connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/charon-cmd/cmd/cmd_connection.c b/src/charon-cmd/cmd/cmd_connection.c index 65e522765..9b19bb45c 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,