ip_chk_addr() and multi-interface machines during bootp

From: Nikos Mouat (nikm@cyberflunk.com)
Date: Tue May 09 2000 - 21:12:10 EST


Hi,
   I've been working on a problem I've been having with uClinux (under
2.0.38 if anyone still remembers what that is). Here's the situation:
I have two ethernet devices and when one of them is trying to obtain a
DHCP lease, the other device is inoperable until the lease has been
obtained. This boiled down to one ethernet not working when the other was
set to 0.0.0.0. After doing some packet dumps and poking around, i
discovered that packets really were getting sent out the non-zero
interface, but they had the destination mac address incorrectly set to
their own mac address (!!). After much struggle, I found the cause to be
in arp_bind_cache(). That routine does a ip_chk_addr()) which checks to
see the the address
is a local one. if it is, we call arp_set_predefined to set the mac
address to the mac address of the local interface.

but when one of the other interfaces is set to zero, ip_chk_addr()
will always return IS_MYADDR:

int ip_chk_addr(unsigned long addr)
{
 [...]
        for (dev = dev_base; dev != NULL; dev = dev->next)
        {
 [...]
                if (dev->pa_addr == 0)
                        return IS_MYADDR;
 [...]
        }
 [...]
}

so I added a ip_chk_addr_my_dev_only which includes the device we're
concerned about - thus I skip the whole for loop and look only at that
one interface.. and now I can talk on this interface while another
interface is set to zero!

is this an OK solution or am I missing something and will break all other
apps? my dhcp client works fine now.. does this bug/feature exist in later
kernels??

??

Thanks!
nm

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:15 EST