Subject: Re: Incorrect source IP address used after an ifconfig
To: Shiva Shenoy <shiva_s@yahoo.com>
From: Rafal Boni <rafal@mediaone.net>
List: tech-kern
Date: 01/08/2001 08:44:53
In message <20010105231214.19146.qmail@web11607.mail.yahoo.com>, Shiva wrote: 

-> Noticed this behavior on NetBSD 1.5.

I've seen this happen on post-1.5 current (1.5Q or P) as well.  I was having
problems with my 802.11 card and DHCP, so I forgot to mention this, but the
situation was similar...

-> Cloned ARP entries dont seem to get deleted after 
-> an IP interface is deleted.
-> 
-> This is the sequence of commands that I execute:
-> (tlp0 has 137.1.1.1 netmask 255.255.0.0)
-> - ping a neighbor PC on the tlp0 interface - 137.1.1.5
-> - remove the only address "ifconfig tlp0 delete"
-> - reconfig a different address on tlp0
-> (ifconfig tlp0 inet 137.1.1.2 netmask 255.255.0.0 up)
-> - ping the neighbor again. ICMP packets have
->  the source address of 137.1.1.1 (the old address). 

In my case it was:
	(1) Run dhclient on wi0
	(2) Get an IP address.
	(3) Due to DHCP server config issues have another node steal 
	    my IP.
	(4) Ifconfig up by hand a known-free address, see tcpdump show the
	    old address as source of ICMPs.

I'll send-pr this if I can still get it to happen with a kernel of more 
recent vintage.

-> The reason? The ARP to the neighbor does not seem to
-> get deleted when the interface address gets deleted.
-> I think this is incorrect. All cloned entries that
-> have this interface address should be blown away too.

--rafal

----
Rafal Boni                                                  rafal@mediaone.net