Check routes with equal prefix if preferred source is specified
This commit is contained in:
parent
9d6b02d6c1
commit
cef0a8118e
|
@ -1236,8 +1236,10 @@ static host_t *get_route(private_kernel_netlink_net_t *this, host_t *dest,
|
|||
}
|
||||
rta = RTA_NEXT(rta, rtasize);
|
||||
}
|
||||
if (msg->rtm_dst_len <= best)
|
||||
{ /* not better than a previous one */
|
||||
if (msg->rtm_dst_len < best ||
|
||||
msg->rtm_dst_len == best && (nexthop || !candidate))
|
||||
{ /* not better than a previous one, but if a preferred source
|
||||
* address is specified, we still check equal routes */
|
||||
continue;
|
||||
}
|
||||
enumerator = this->rt_exclude->create_enumerator(this->rt_exclude);
|
||||
|
|
Loading…
Reference in New Issue