On Wed, Sep 26, 2018 at 04:57:02PM -0300, Martin Pieuchot wrote:
> Thanks the problem is that the current code assume that every RTF_LLINFO
> route is a cloned one, which is not always true. Diff below uses the
> correct check for this assertion, and I'd like to commit it before 6.4.
>
> Any ok?
OK bluhm@
> Index: net/route.c
> ===================================================================
> RCS file: /cvs/src/sys/net/route.c,v
> retrieving revision 1.377
> diff -u -p -r1.377 route.c
> --- net/route.c 11 Jul 2018 19:52:19 -0000 1.377
> +++ net/route.c 26 Sep 2018 19:56:47 -0000
> @@ -396,10 +396,11 @@ rt_setgwroute(struct rtentry *rt, u_int
> struct sockaddr_in6 sa_mask;
>
> /*
> - * If we found a non-L2 entry on a different interface
> - * there's nothing we can do.
> + * If we found a non cloned L2 entry on a different
> + * interface, don't try to find a corresponding gateway.
> */
> - if (!ISSET(nhrt->rt_flags, RTF_LLINFO)) {
> + if (!ISSET(nhrt->rt_flags, RTF_LLINFO) ||
> + !ISSET(nhrt->rt_flags, RTF_CLONED)) {
> rtfree(nhrt);
> return (EHOSTUNREACH);
> }