Subject: Re: [PATCH] Move inetdev/ifa over to RCU

From: "David S. Miller" <[email-masked]>
Date: Sun, 15 Aug 2004 19:08:23 -0700

On Sat, 14 Aug 2004 15:08:48 +1000
Herbert Xu <[email-masked]> wrote:

> I'm just going through all the __in_dev_get() callers and the one
> in ip_route_output_slow() looks fishy.  It appears to be checking
> whether the subsequent inet_select_addr() calls will succeed or not.
> 
> But this is not reliable since the addresses can always disappear
> between the check and the actual call.
> 
> Do we really care about the zero return value of inet_select_addr()
> here? What about the other calls to inet_select_addr()?

It won't return zero, typically it will return loopback's IP
(with preference to any non-loopback addresses assigned to
 the loopback device).  This is being used for source address
selection.

Also, when device ipv4 addresses are deleted, NETDEV_DOWN messages
are broadcast to all the subsystems.  One of the subsystems is FIB,
which will disable IP on that interface if this is the last ipv4
address and it will also flush the routing cache immediately.
However you are right that we may need to synchronize this more
tightly.

Hmmm....