On Sat, Jun 23, 2012 at 07:37:31AM +0200, Eric Dumazet wrote:> All other /proc/net files don't have a such sophisticated walkers aware> mechanism

I can explain why.

IPv6 routing table has a capital management drawback: core policy rules are mixedwith dynamic cache and addrconf routes in one structure.(BTW it is one of reasons why I did not want to integrate routing cache to fib for IPv4)

Do you see the problem? F.e. when you do iptables-save, you do not expectthat it can occasionally miss some rules (unless you mess with it in parallel, of course)The same is here. When you dump routing table, you are allowed to miss some cache routes,but if you have a chance to miss at least one of important routes just becauseunimportant dynamic part is alway under change, it is fatal.

There are a lot of ways to solve the problem, all of them have some flaws.F.e. I can remember:* atomic dump like bsd sysctl.* keeping administrative routes in a separate list, which can be walked using skip/countetc.

This way with walkers I chose because it looked quite optimal and becauseit was an exciting little task for brains . :-)

> (easily DOSable by the way, if some guy opens 10.000 handles> and suspend in the middle the dumps).

This is true. The easiest way to fix this is just to limit amount of readers,putting them on hold.