aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2014-05-06 15:38:30 +0200
committerMartin Willi <martin@revosec.ch>2014-05-07 14:13:39 +0200
commit682c9966fa0cb8e6b066df5f403a80f1469108d4 (patch)
treeb0ca3e92275171f60e7c205e054d8dcf346a6d5d /src
parentdffd60083db66eaa5c9ae4480456902c36733d96 (diff)
downloadstrongswan-682c9966fa0cb8e6b066df5f403a80f1469108d4.tar.bz2
strongswan-682c9966fa0cb8e6b066df5f403a80f1469108d4.tar.xz
vici: Fallback to socket listening port if no explicit local port specified
Diffstat (limited to 'src')
-rw-r--r--src/libcharon/plugins/vici/vici_config.c5
1 files changed, 4 insertions, 1 deletions
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)
{