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: 66e9165bc6 ("kernel-netlink: Return outbound interface in get_nexthop()")
Signed-off-by: Christophe Gouault <[email protected]>
This commit is contained in:
committed by
Tobias Brunner
parent
a617223ed5
commit
a63a7af197
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user