diff options
author | Tobias Brunner <tobias@strongswan.org> | 2014-03-11 15:19:33 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2014-03-31 14:32:44 +0200 |
commit | 7522fcffd26b96031cc4efc88b1ceb1220459f4d (patch) | |
tree | 644ce26d0c0b1817559201c7f2466bd23c80dab3 /src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c | |
parent | 5119c5fe97428fdceac1f89b3c77a72cf5f10f3a (diff) | |
download | strongswan-7522fcffd26b96031cc4efc88b1ceb1220459f4d.tar.bz2 strongswan-7522fcffd26b96031cc4efc88b1ceb1220459f4d.tar.xz |
kernel-pfroute: Let get_nexthop() default to destination address
Diffstat (limited to 'src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c')
-rw-r--r-- | src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c index a8a57a5a2..63c38bb7c 100644 --- a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c +++ b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c @@ -1576,16 +1576,20 @@ retry: } DBG1(DBG_KNL, "PF_ROUTE lookup failed: %s", strerror(errno)); } - if (!host) + if (nexthop) { - return NULL; + host = host ?: dest->clone(dest); } - if (!nexthop) + else { /* make sure the source address is not virtual and usable */ addr_entry_t *entry, lookup = { .ip = host, }; + if (!host) + { + return NULL; + } this->lock->read_lock(this->lock); entry = this->addrs->get_match(this->addrs, &lookup, (void*)addr_map_entry_match_up_and_usable); |