From 682c9966fa0cb8e6b066df5f403a80f1469108d4 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 6 May 2014 15:38:30 +0200 Subject: [PATCH] vici: Fallback to socket listening port if no explicit local port specified --- src/libcharon/plugins/vici/vici_config.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libcharon/plugins/vici/vici_config.c b/src/libcharon/plugins/vici/vici_config.c index 34a0f4670..c180b0e7d 100644 --- a/src/libcharon/plugins/vici/vici_config.c +++ b/src/libcharon/plugins/vici/vici_config.c @@ -1709,7 +1709,6 @@ CALLBACK(config_sn, bool, .pull = TRUE, .send_cert = CERT_SEND_IF_ASKED, .version = IKE_ANY, - .local_port = IKEV2_UDP_PORT, .remote_port = IKEV2_UDP_PORT, .fragmentation = FRAGMENTATION_NO, .unique = UNIQUE_NO, @@ -1759,6 +1758,10 @@ CALLBACK(config_sn, bool, { peer.remote_addrs = strdup("%any"); } + if (!peer.local_port) + { + peer.local_port = charon->socket->get_port(charon->socket, FALSE); + } if (peer.over_time == LFT_UNDEFINED) {