aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2013-08-21 16:52:19 +0200
committerTobias Brunner <tobias@strongswan.org>2013-08-21 17:01:03 +0200
commitd7ae0b254da55abc033745106a958d5fa2ebd175 (patch)
tree2550de52be5714c65bec04e51f46141f5add4535
parent85ca2f74419f9d0162d8a6f1af5525fbe44c632f (diff)
downloadstrongswan-d7ae0b254da55abc033745106a958d5fa2ebd175.tar.bz2
strongswan-d7ae0b254da55abc033745106a958d5fa2ebd175.tar.xz
kernel: Restore enumeration of all addresses when searching for address in TS
Since f52cf07532 addresses on ignored, down or loopback interfaces were not considered as valid addresses anymore when searching for an address contained in the local traffic selector. This meant that route installation failed, for instance, if charon.install_virtual_ip_on was set to 'lo', or, on gateways, if internal interfaces were ignored with the charon.interfaces_* options.
-rw-r--r--src/libhydra/kernel/kernel_interface.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libhydra/kernel/kernel_interface.c b/src/libhydra/kernel/kernel_interface.c
index 90637fa06..68a8c3ec1 100644
--- a/src/libhydra/kernel/kernel_interface.c
+++ b/src/libhydra/kernel/kernel_interface.c
@@ -447,7 +447,9 @@ METHOD(kernel_interface_t, get_address_by_ts, status_t,
}
host->destroy(host);
- addrs = create_address_enumerator(this, ADDR_TYPE_VIRTUAL);
+ /* try virtual IPs only first (on all interfaces) */
+ addrs = create_address_enumerator(this,
+ ADDR_TYPE_ALL ^ ADDR_TYPE_REGULAR);
while (addrs->enumerate(addrs, (void**)&host))
{
if (ts->includes(ts, host))
@@ -464,8 +466,9 @@ METHOD(kernel_interface_t, get_address_by_ts, status_t,
addrs->destroy(addrs);
if (!found)
- {
- addrs = create_address_enumerator(this, ADDR_TYPE_REGULAR);
+ { /* then try the regular addresses (on all interfaces) */
+ addrs = create_address_enumerator(this,
+ ADDR_TYPE_ALL ^ ADDR_TYPE_VIRTUAL);
while (addrs->enumerate(addrs, (void**)&host))
{
if (ts->includes(ts, host))