Subject: ARP routing entries after interface shutdown
To: None <tech-kern@netbsd.org>
From: None <drochner@zel459.zel.kfa-juelich.de>
List: tech-kern
Date: 02/21/1999 12:52:07
I was hit by a problem when I switched between 2 network
interfaces connected to the same physical network:
After a card was shut down (ie, addresses deleted and
set "down") ARP entries were left in the routing table, so
that I couldn't connect to these destination hosts via the
other card - got ENETDOWN because it still tried to use the
stale entry.

It's easily reproduced:
zelz26# netstat -i
Name  Mtu   Network       Address              Ipkts Ierrs    Opkts Oerrs  Coll
ex0*  1500  <Link>        00:10:4b:dc:b2:b0      636     0       12     0     0
[...]
zelz26# ifconfig ex0 ikpd10 netmask 0xffffff00
zelz26# ping ikpgem01
[success]
zelz26# netstat -r
[...]
G07-01-01/24       link#1             UC          0        0      -  ex0
ikpgem01.ikp.kfa-j 08:00:2b:2e:1f:3b  UHL         0        2      -  ex0
zelz26# ifconfig ex0 delete
zelz26# ifconfig ex0 down
zelz26# netstat -i
Name  Mtu   Network       Address              Ipkts Ierrs    Opkts Oerrs  Coll
ex0*  1500  <Link>        00:10:4b:dc:b2:b0     1454     0       16     0     0
[...]
zelz26# netstat -r
[...]
ikpgem01.ikp.kfa-j 08:00:2b:2e:1f:3b  UHL         0        2      -  ex0
[...]
zelz26# ping ikpgem01
PING ikpgem01 (134.94.202.151): 56 data bytes
ping: sendto: Network is down

I'd call this a bug, or at least a violation of the principle of
least surprise.
Why are the routing entries related to an interface not purged
when the interface is shut down? The code in if.c:if_down() looks
as if it was supposed to do these things.
(NetBSD-current/i386)

best regards
Matthias