Subject: ip addr flush hangs

From: Olaf Kirch <[email-masked]>
Date: Tue, 9 Mar 2004 15:48:24 +0100

Hi,

I'm currently debugging the following problem: on a 2.6.3
kernel, when doing this

	ifconfig eth0 down
	ip addr flush dev eth0

The second command hangs indefinitely. The reason is that the kernel
reports ipv6-all-hosts (ff02::1) when dumping all addresses, but
RTM_DELADDR on ff02::1 doesn't do anything. As /sbin/ip will loop until
the kernel reports no more matching addresses, it will go on like that
forever.

I don't see an obvious fix to this issue. On one hand, calling ifconfig
down will result in a call to addrconf_ifdown(dev, 0).  This will clear
the list of unicast addresses assigned to this interface, but will not
clear the list of multicast addresses (it unloads them from the NIC,
and sends IGMP leave packets, but the list of addresses will remain
attached to the device). So it doesn't destroy the interface completely,
it zaps its state just partly, intentionally.

On the other hand, if you manually remove all addresses from the
interface, this will result in a call to addrconf_ifdown(dev, 1),
causing the mcast list to be zapped as well.

This is not entirely consistent. Should a NETDEV_DOWN zap the
ipv6 configuration completely?

Olaf
-- 
Olaf Kirch     |  Stop wasting entropy - start using predictable
[email-masked]   |  tempfile names today!
---------------+