diff options
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index dc9549b5eb1c..ab1e7c7c38fc 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -461,11 +461,7 @@ static void rt_cache_invalidate(struct net *net) | |||
461 | atomic_add(shuffle + 1U, &net->ipv4.rt_genid); | 461 | atomic_add(shuffle + 1U, &net->ipv4.rt_genid); |
462 | } | 462 | } |
463 | 463 | ||
464 | /* | 464 | void rt_cache_flush(struct net *net) |
465 | * delay < 0 : invalidate cache (fast : entries will be deleted later) | ||
466 | * delay >= 0 : invalidate & flush cache (can be long) | ||
467 | */ | ||
468 | void rt_cache_flush(struct net *net, int delay) | ||
469 | { | 465 | { |
470 | rt_cache_invalidate(net); | 466 | rt_cache_invalidate(net); |
471 | } | 467 | } |
@@ -2345,7 +2341,7 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
2345 | 2341 | ||
2346 | void ip_rt_multicast_event(struct in_device *in_dev) | 2342 | void ip_rt_multicast_event(struct in_device *in_dev) |
2347 | { | 2343 | { |
2348 | rt_cache_flush(dev_net(in_dev->dev), 0); | 2344 | rt_cache_flush(dev_net(in_dev->dev)); |
2349 | } | 2345 | } |
2350 | 2346 | ||
2351 | #ifdef CONFIG_SYSCTL | 2347 | #ifdef CONFIG_SYSCTL |
@@ -2354,16 +2350,7 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write, | |||
2354 | size_t *lenp, loff_t *ppos) | 2350 | size_t *lenp, loff_t *ppos) |
2355 | { | 2351 | { |
2356 | if (write) { | 2352 | if (write) { |
2357 | int flush_delay; | 2353 | rt_cache_flush((struct net *)__ctl->extra1); |
2358 | ctl_table ctl; | ||
2359 | struct net *net; | ||
2360 | |||
2361 | memcpy(&ctl, __ctl, sizeof(ctl)); | ||
2362 | ctl.data = &flush_delay; | ||
2363 | proc_dointvec(&ctl, write, buffer, lenp, ppos); | ||
2364 | |||
2365 | net = (struct net *)__ctl->extra1; | ||
2366 | rt_cache_flush(net, flush_delay); | ||
2367 | return 0; | 2354 | return 0; |
2368 | } | 2355 | } |
2369 | 2356 | ||