Hi,

On 08/09/2020 14:36, Vladislav Grishenko wrote:
> Netlink route request with NLM_F_DUMP flag set means to return
> all entries matching criteria passed in message content -
> matching supplied family & dst address in our case.
> So, gateway from the first ipv4 route was always used.
> 
> On kernels earlier than 2.6.38 default routes are the last ones,
> so arbitrary host/net route w/o gateway is likely be returned as
> first, causing gateway to be invalid or empty.
> After refactoring in 2.6.38 kernel default routes are on top, so
> the problem with older kernels was hidden.
> 
> Fix this behavior by selecting first 0.0.0.0/0 if dst was not set
> or empty. For IPv6, no behavior is changed - request ::/128 route,
> so just clarify the sizes via netlink route api.
> 
> Tested on 5.4.0, 4.1.51, 2.6.36 and 2.6.22 kernels.
> 
> Signed-off-by: Vladislav Grishenko <themi...@yandex-team.ru>

Thanks for taking care of this issue and for digging into the sitnl code.

The change is really contained and and easy to review.
Tested a bit and it works as expected.

Acked-by: Antonio Quartulli <a...@unstable.cc>

-- 
Antonio Quartulli




_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to