}
#ifdef CONFIG_SYSCTL
-static int flush_delay;
-
static int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write,
struct file *filp, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
if (write) {
+ int flush_delay;
+ static DEFINE_MUTEX(flush_mutex);
+
+ mutex_lock(&flush_mutex);
+ ctl->data = &flush_delay;
proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
+ ctl->data = NULL;
+ mutex_unlock(&flush_mutex);
+
rt_cache_flush(&init_net, flush_delay);
return 0;
}
{
.ctl_name = NET_IPV4_ROUTE_FLUSH,
.procname = "flush",
- .data = &flush_delay,
.maxlen = sizeof(int),
.mode = 0200,
.proc_handler = &ipv4_sysctl_rtcache_flush,