X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fipv4%2Froute.c;h=e4ab0ac94f9225f4ac9f6d2f12d4ece0c1383400;hb=f8b71a3a92d69cb1c9c2162f9235d3dd550e4aa0;hp=113cd2512ba7aebf363e51b5936a2b37ad00f2e1;hpb=ea2aca084ba82aaf7c148d04914ceed8758ce08a;p=linux-2.6 diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 113cd2512b..e4ab0ac94f 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1429,7 +1429,8 @@ static int ip_error(struct sk_buff *skb) break; case ENETUNREACH: code = ICMP_NET_UNREACH; - IP_INC_STATS_BH(IPSTATS_MIB_INNOROUTES); + IP_INC_STATS_BH(dev_net(rt->u.dst.dev), + IPSTATS_MIB_INNOROUTES); break; case EACCES: code = ICMP_PKT_FILTERED; @@ -2873,22 +2874,20 @@ void ip_rt_multicast_event(struct in_device *in_dev) } #ifdef CONFIG_SYSCTL -static int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write, +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; + ctl_table ctl; struct net *net; - 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); + memcpy(&ctl, __ctl, sizeof(ctl)); + ctl.data = &flush_delay; + proc_dointvec(&ctl, write, filp, buffer, lenp, ppos); - net = (struct net *)ctl->extra1; + net = (struct net *)__ctl->extra1; rt_cache_flush(net, flush_delay); return 0; }