]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/sysctl_net_ipv4.c
net: implement emergency route cache rebulds when gc_elasticity is exceeded
[net-next-2.6.git] / net / ipv4 / sysctl_net_ipv4.c
index 1bb10df8ce7dd94b89a0b43b170307557cf521f0..0cc8d31f9ac0edad1012664bab4180d51589013e 100644 (file)
@@ -795,6 +795,14 @@ static struct ctl_table ipv4_net_table[] = {
                .mode           = 0644,
                .proc_handler   = &proc_dointvec
        },
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "rt_cache_rebuild_count",
+               .data           = &init_net.ipv4.sysctl_rt_cache_rebuild_count,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec
+       },
        { }
 };
 
@@ -827,8 +835,12 @@ static __net_init int ipv4_sysctl_init_net(struct net *net)
                        &net->ipv4.sysctl_icmp_ratelimit;
                table[5].data =
                        &net->ipv4.sysctl_icmp_ratemask;
+               table[6].data =
+                       &net->ipv4.sysctl_rt_cache_rebuild_count;
        }
 
+       net->ipv4.sysctl_rt_cache_rebuild_count = 4;
+
        net->ipv4.ipv4_hdr = register_net_sysctl_table(net,
                        net_ipv4_ctl_path, table);
        if (net->ipv4.ipv4_hdr == NULL)