Subject: Re: RFC: local address selection
To: Tom Ivar Helbekkmo <itojun@iijlab.net, tih@eunetnorge.no>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: tech-net
Date: 11/12/2004 11:11:25
Emmanuel Dreyfus <manu@netbsd.org> wrote:

> ifconfig lo0 alias ${INTERNAL_ADDR}

Here is the problem: sys/netinet/in_pcb.c:in_selectsrc() excludes any
address flagged IFF_LOOPBACK:

        /* Find 1st non-loopback AF_INET address */
        TAILQ_FOREACH(ia, &in_ifaddrhead, ia_list) {             
                if (!(ia->ia_ifp->if_flags & IFF_LOOPBACK))
                        break;
        }

If I add the internal address on the ethernet interface then everything
turns okay.

So route -ifa works, except if the address was attached to a local
interface. In that situation, route -ifa is only honoured for ICMP
packets, and not for TCP and UDP packets.

Is it a bug to fix? 

-- 
Emmanuel Dreyfus
Il y a 10 sortes de personnes dans le monde: ceux qui comprennent 
le binaire et ceux qui ne le comprennent pas.
manu@netbsd.org