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.
This commit is contained in:
Tobias Brunner
2016-06-10 13:54:18 +02:00
parent 436f64d5bc
commit 99a57aa5ee
10 changed files with 42 additions and 21 deletions
@@ -308,7 +308,7 @@ static void add_exclude_route(private_kernel_libipsec_ipsec_t *this,
if (!route->exclude)
{
DBG2(DBG_KNL, "installing new exclude route for %H src %H", dst, src);
gtw = charon->kernel->get_nexthop(charon->kernel, dst, -1, NULL);
gtw = charon->kernel->get_nexthop(charon->kernel, dst, -1, NULL, NULL);
if (gtw)
{
char *if_name = NULL;
@@ -434,7 +434,8 @@ static bool install_route(private_kernel_libipsec_ipsec_t *this,
);
#ifndef __linux__
/* on Linux we cant't install a gateway */
route->gateway = charon->kernel->get_nexthop(charon->kernel, dst, -1, src);
route->gateway = charon->kernel->get_nexthop(charon->kernel, dst, -1, src,
NULL);
#endif
if (policy->route)