vici: Fallback to socket listening port if no explicit local port specified

This commit is contained in:
Martin Willi
2014-05-07 14:13:39 +02:00
parent dffd60083d
commit 682c9966fa
+4 -1
View File
@@ -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)
{