Subject: Re: BUG ? ipip unregister_netdevice_many()

From: [email-masked] (Eric W. Biederman)
Date: Fri, 08 Oct 2010 10:32:40 -0700

David Miller <[email-masked]> writes:

> From: [email-masked] (Eric W. Biederman)
> Date: Fri, 08 Oct 2010 09:45:15 -0700
>
>> My hunch is that we have dst entry problems, as I know those hop network
>> interfaces when we destroy network devices, but I have seen weird issues
>> with the route cache as well.
>
> While we're on this topic, can someone explain to me what the special
> CONFIG_NET_NS code in net/ipv4/route.c:rt_do_flush() is trying to
> accomplish?
>
> If the issue is that there is an implicit ordering of releasing of
> 'dst' entries that must be maintained, we really ought to formalize
> it (f.e. with dependency pointers or something like that).

It is just dealing with not flushing the entire routing cache, just the
routes that have expired.  Which prevents one network namespace from
flushing it's routes and DOS'ing another.

The practical consequence is that the hash chains have to be picked
apart with some entries kept and some released based upon
rt_is_expired().

I went through it a year or so ago with a fine tooth comb and it made
sense and seems correct, but it does seem overly convoluted.

Eric