Subject: Re: if_null
To: Andrew Brown <atatat@atatdot.net>
From: Steven M. Bellovin <smb@research.att.com>
List: tech-net
Date: 04/08/2004 09:44:37
In message <20040408113906.C9D0D7B44@berkshire.research.att.com>, "Steven M. Be
llovin" writes:

>>indeed, i had trouble making mine do "the right thing" with ipv6.
>>does yours do do?  for some reason, i was always able to ping whatever
>>v6 address i assigned to the interface, leading me to believe that v6
>>was something i needed to know yet more about when i had more time...
>>
>Hmm, I'm seeing the same behavior.  The problem is, I think, at a 
>higher level -- the host IP address/128 is routed to lo0 when you 
>assign the v6 address.  I'll have to poke around to see where that's 
>happening, and what, if anything, can be done in the driver.
>

Here's the problem.  In the routine in in6.c that initializes an 
interface, the following code appears:

        if (newhost) {
                /* set the rtrequest function to create llinfo */
                ia->ia_ifa.ifa_rtrequest = nd6_rtrequest;
                in6_ifaddloop(&(ia->ia_ifa));
        }

Ultimately, that calls a routine with this comment:

/*      
 * Add ownaddr as loopback rtentry.  We previously add the route only if
 * necessary (ex. on a p2p link).  However, since we now manage addresses
 * separately from prefixes, we should always add the route.  We can't
 * rely on the cloning mechanism from the corresponding interface route
 * any more.    
 */

The question is why it does that -- the ipv4 code does *not* do that.

		--Steve Bellovin, http://www.research.att.com/~smb