support for per/namespace routing cache cleanup v2
Subsystems (2)
PATCH 3/3 support for per/namespace routing cache cleanup v2
commit 4fb98b7f7e461b7ce5b0b3c1420ffa5f68e125f5
Author: Denis V. Lunev <[email protected]> Date: Thu Oct 18 13:39:44 2007 +0400
/proc/sys/net/route/flush should be accessible inside the net namespace. Though, the complete opening of this file will result in a DoS or significant entire host slowdown if a namespace process will continually flush routes.
This patch introduces per/namespace route flush facility.
Each namespace wanted to flush a cache copies global generation count to itself and starts the timer. The cache is dropped for a specific namespace iff the namespace counter is greater or equal global ones.
So, in general, unwanted namespaces do nothing. They hold very old low counter and they are unaffected by the requested cleanup.
Changes from V1:
- added struct net * parameter to rt_cache_flush (thanks Daniel)
- rt_secret_rebuild drop all the cache
include/net/net_namespace.h +2 -0
@@ -143,6 +143,8 @@ struct net {/* iptable_filter.c */ struct xt_table *ip_packet_filter; + +unsigned long rt_flush_required; };extern struct net init_net;
net/ipv4/route.c +79 -5
122 lines not on this page · raw message