diff options
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index cedc366505bd..790de32cd7d4 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2829,14 +2829,20 @@ void ip_rt_multicast_event(struct in_device *in_dev) | |||
2829 | } | 2829 | } |
2830 | 2830 | ||
2831 | #ifdef CONFIG_SYSCTL | 2831 | #ifdef CONFIG_SYSCTL |
2832 | static int flush_delay; | ||
2833 | |||
2834 | static int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write, | 2832 | static int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write, |
2835 | struct file *filp, void __user *buffer, | 2833 | struct file *filp, void __user *buffer, |
2836 | size_t *lenp, loff_t *ppos) | 2834 | size_t *lenp, loff_t *ppos) |
2837 | { | 2835 | { |
2838 | if (write) { | 2836 | if (write) { |
2837 | int flush_delay; | ||
2838 | static DEFINE_MUTEX(flush_mutex); | ||
2839 | |||
2840 | mutex_lock(&flush_mutex); | ||
2841 | ctl->data = &flush_delay; | ||
2839 | proc_dointvec(ctl, write, filp, buffer, lenp, ppos); | 2842 | proc_dointvec(ctl, write, filp, buffer, lenp, ppos); |
2843 | ctl->data = NULL; | ||
2844 | mutex_unlock(&flush_mutex); | ||
2845 | |||
2840 | rt_cache_flush(&init_net, flush_delay); | 2846 | rt_cache_flush(&init_net, flush_delay); |
2841 | return 0; | 2847 | return 0; |
2842 | } | 2848 | } |
@@ -2865,7 +2871,6 @@ ctl_table ipv4_route_table[] = { | |||
2865 | { | 2871 | { |
2866 | .ctl_name = NET_IPV4_ROUTE_FLUSH, | 2872 | .ctl_name = NET_IPV4_ROUTE_FLUSH, |
2867 | .procname = "flush", | 2873 | .procname = "flush", |
2868 | .data = &flush_delay, | ||
2869 | .maxlen = sizeof(int), | 2874 | .maxlen = sizeof(int), |
2870 | .mode = 0200, | 2875 | .mode = 0200, |
2871 | .proc_handler = &ipv4_sysctl_rtcache_flush, | 2876 | .proc_handler = &ipv4_sysctl_rtcache_flush, |