On Wed, Oct 21, 2015 at 10:16:59AM +0200, Martin Pieuchot wrote:
> Now that we "fixed" this historical hack, we have:
>
> rt_ifa->ifa_ifp == rt_ifp
>
> Ok?
OK bluhm@
>
> Index: netinet6/nd6.c
> ===================================================================
> RCS file: /cvs/src/sys/netinet6/nd6.c,v
> retrieving revision 1.155
> diff -u -p -r1.155 nd6.c
> --- netinet6/nd6.c 1 Oct 2015 09:10:22 -0000 1.155
> +++ netinet6/nd6.c 21 Oct 2015 08:11:05 -0000
> @@ -689,15 +689,10 @@ nd6_lookup(struct in6_addr *addr6, int c
> * route from a parent route that has the L flag (e.g. the default
> * route to a p2p interface) may have the flag, too, while the
> * destination is not actually a neighbor.
> - * XXX: we can't use rt->rt_ifp to check for the interface, since
> - * it might be the loopback interface if the entry is for our
> - * own address on a non-loopback interface. Instead, we should
> - * use rt->rt_ifa->ifa_ifp, which would specify the REAL
> - * interface.
> */
> if ((rt->rt_flags & RTF_GATEWAY) || (rt->rt_flags & RTF_LLINFO) == 0 ||
> rt->rt_gateway->sa_family != AF_LINK || rt->rt_llinfo == NULL ||
> - (ifp && rt->rt_ifa->ifa_ifp != ifp)) {
> + (ifp != NULL && rt->rt_ifp != ifp)) {
> if (create) {
> char addr[INET6_ADDRSTRLEN];
> nd6log((LOG_DEBUG, "%s: failed to lookup %s (if=%s)\n",