summaryrefslogtreecommitdiff
path: root/src/libcharon/plugins/kernel_iph/kernel_iph_net.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2016-07-16 15:19:53 +0200
committerYves-Alexis Perez <corsac@debian.org>2016-07-16 15:19:53 +0200
commita4ab9f7f145c94a5eeb950b92b95c3d362baee67 (patch)
treeb3490a4d2054b18dd1549416216557c8114329aa /src/libcharon/plugins/kernel_iph/kernel_iph_net.c
parent7c6a8194526dc1035140a3157a07b2d9dbfedc59 (diff)
parentbf372706c469764d59e9f29c39e3ecbebd72b8d2 (diff)
downloadvyos-strongswan-a4ab9f7f145c94a5eeb950b92b95c3d362baee67.tar.gz
vyos-strongswan-a4ab9f7f145c94a5eeb950b92b95c3d362baee67.zip
Merge tag 'upstream/5.5.0'
Upstream version 5.5.0
Diffstat (limited to 'src/libcharon/plugins/kernel_iph/kernel_iph_net.c')
-rw-r--r--src/libcharon/plugins/kernel_iph/kernel_iph_net.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/libcharon/plugins/kernel_iph/kernel_iph_net.c b/src/libcharon/plugins/kernel_iph/kernel_iph_net.c
index 6a8a96821..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);
@@ -617,7 +622,7 @@ METHOD(kernel_net_t, del_ip, status_t,
* Add or remove a route
*/
static status_t manage_route(private_kernel_iph_net_t *this, bool add,
- chunk_t dst, u_int8_t prefixlen, host_t *gtw, char *name)
+ chunk_t dst, uint8_t prefixlen, host_t *gtw, char *name)
{
MIB_IPFORWARD_ROW2 row = {
.DestinationPrefix = {
@@ -705,14 +710,14 @@ static status_t manage_route(private_kernel_iph_net_t *this, bool add,
}
METHOD(kernel_net_t, add_route, status_t,
- private_kernel_iph_net_t *this, chunk_t dst, u_int8_t prefixlen,
+ private_kernel_iph_net_t *this, chunk_t dst, uint8_t prefixlen,
host_t *gateway, host_t *src, char *name)
{
return manage_route(this, TRUE, dst, prefixlen, gateway, name);
}
METHOD(kernel_net_t, del_route, status_t,
- private_kernel_iph_net_t *this, chunk_t dst, u_int8_t prefixlen,
+ private_kernel_iph_net_t *this, chunk_t dst, uint8_t prefixlen,
host_t *gateway, host_t *src, char *name)
{
return manage_route(this, FALSE, dst, prefixlen, gateway, name);