aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c
diff options
context:
space:
mode:
authorChristophe Gouault <christophe.gouault@6wind.com>2016-10-12 18:12:08 +0200
committerTobias Brunner <tobias@strongswan.org>2016-10-12 19:25:31 +0200
commita63a7af197ceabc0fcf66e481702488185413267 (patch)
treea161f7d036723b6eec6c2ff7536786835576f281 /src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c
parenta617223ed5f2763705f98164ebe15dc3421f95e5 (diff)
downloadstrongswan-a63a7af197ceabc0fcf66e481702488185413267.tar.bz2
strongswan-a63a7af197ceabc0fcf66e481702488185413267.tar.xz
kernel-netlink: Fix get_route() interface determination
A wrong variable is used (route instead of best), so much that the returned interface belongs to the last seen route instead of the best choice route. get_route() may therefore return mismatching interface and gateway. Fixes: 66e9165bc686 ("kernel-netlink: Return outbound interface in get_nexthop()") Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
Diffstat (limited to 'src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c')
-rw-r--r--src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c b/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c
index b9d326941..0132f7269 100644
--- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c
+++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c
@@ -1995,9 +1995,9 @@ static host_t *get_route(private_kernel_netlink_net_t *this, host_t *dest,
if (best || routes->get_first(routes, (void**)&best) == SUCCESS)
{
addr = host_create_from_chunk(msg->rtm_family, best->gtw, 0);
- if (iface && route->oif)
+ if (iface && best->oif)
{
- *iface = get_interface_name_by_index(this, route->oif);
+ *iface = get_interface_name_by_index(this, best->oif);
}
}
if (!addr && !match_net)