diff options
author | Tobias Brunner <tobias@strongswan.org> | 2016-03-11 18:54:31 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2016-06-10 13:54:18 +0200 |
commit | 99a57aa5ee15affa9e38595d90971031977e34be (patch) | |
tree | 701a88959db7936158a1187270ddc9de32ddd8c4 /src/libcharon/plugins/kernel_iph/kernel_iph_net.c | |
parent | 436f64d5bcc3946387dd95265d83d8764fe37797 (diff) | |
download | strongswan-99a57aa5ee15affa9e38595d90971031977e34be.tar.bz2 strongswan-99a57aa5ee15affa9e38595d90971031977e34be.tar.xz |
kernel-net: Let get_nexthop() return an optional interface name
The returned name should be the interface over which the destination
address/net is reachable.
Diffstat (limited to 'src/libcharon/plugins/kernel_iph/kernel_iph_net.c')
-rw-r--r-- | src/libcharon/plugins/kernel_iph/kernel_iph_net.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libcharon/plugins/kernel_iph/kernel_iph_net.c b/src/libcharon/plugins/kernel_iph/kernel_iph_net.c index 3633213f3..efeb98045 100644 --- a/src/libcharon/plugins/kernel_iph/kernel_iph_net.c +++ b/src/libcharon/plugins/kernel_iph/kernel_iph_net.c @@ -562,7 +562,8 @@ METHOD(kernel_net_t, get_source_addr, host_t*, } METHOD(kernel_net_t, get_nexthop, host_t*, - private_kernel_iph_net_t *this, host_t *dest, int prefix, host_t *src) + private_kernel_iph_net_t *this, host_t *dest, int prefix, host_t *src, + char **iface) { MIB_IPFORWARD_ROW2 route; SOCKADDR_INET best, *sai_dst, *sai_src = NULL; @@ -592,6 +593,10 @@ METHOD(kernel_net_t, get_nexthop, host_t*, { if (!nexthop->is_anyaddr(nexthop)) { + if (iface) + { + *iface = NULL; + } return nexthop; } nexthop->destroy(nexthop); |