[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7f1f373d-4153-0e3f-7710-341fe2f02db7@6wind.com>
Date: Wed, 11 Sep 2019 13:47:44 +0200
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: Stefano Brivio <sbrivio@...hat.com>,
David Miller <davem@...emloft.net>
Cc: Guillaume Nault <gnault@...hat.com>, Julian Anastasov <ja@....bg>,
David Ahern <dsahern@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] ipv6: Don't use dst gateway directly in
ip6_confirm_neigh()
Le 09/09/2019 à 22:44, Stefano Brivio a écrit :
> This is the equivalent of commit 2c6b55f45d53 ("ipv6: fix neighbour
> resolution with raw socket") for ip6_confirm_neigh(): we can send a
> packet with MSG_CONFIRM on a raw socket for a connected route, so the
> gateway would be :: here, and we should pick the next hop using
> rt6_nexthop() instead.
>
> This was found by code review and, to the best of my knowledge, doesn't
> actually fix a practical issue: the destination address from the packet
> is not considered while confirming a neighbour, as ip6_confirm_neigh()
> calls choose_neigh_daddr() without passing the packet, so there are no
> similar issues as the one fixed by said commit.
>
> A possible source of issues with the existing implementation might come
> from the fact that, if we have a cached dst, we won't consider it,
> while rt6_nexthop() takes care of that. I might just not be creative
> enough to find a practical problem here: the only way to affect this
> with cached routes is to have one coming from an ICMPv6 redirect, but
> if the next hop is a directly connected host, there should be no
> topology for which a redirect applies here, and tests with redirected
> routes show no differences for MSG_CONFIRM (and MSG_PROBE) packets on
> raw sockets destined to a directly connected host.
>
> However, directly using the dst gateway here is not consistent anymore
> with neighbour resolution, and, in general, as we want the next hop,
> using rt6_nexthop() looks like the only sane way to fetch it.
>
> Reported-by: Guillaume Nault <gnault@...hat.com>
> Signed-off-by: Stefano Brivio <sbrivio@...hat.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Powered by blists - more mailing lists