diff options
author | Duan Jiong <duanj.fnst@cn.fujitsu.com> | 2014-02-17 11:23:43 +0400 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-02-26 13:22:53 +0400 |
commit | a97a04ffa2ce28dd1b0905e29a5ba36429ff6d2b (patch) | |
tree | ebda193053c9ace9ac7d4bcd436aa7bb0e8cf04c /net | |
parent | c92210fdc60d7be2ece4fbdbdd82d811355583d8 (diff) | |
download | linux-a97a04ffa2ce28dd1b0905e29a5ba36429ff6d2b.tar.xz |
ipv4: fix counter in_slow_tot
[ Upstream commit a6254864c08109c66a194612585afc0439005286 ]
since commit 89aef8921bf("ipv4: Delete routing cache."), the counter
in_slow_tot can't work correctly.
The counter in_slow_tot increase by one when fib_lookup() return successfully
in ip_route_input_slow(), but actually the dst struct maybe not be created and
cached, so we can increase in_slow_tot after the dst struct is created.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/route.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 62290b5124c8..2557b9a52373 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1596,6 +1596,7 @@ static int __mkroute_input(struct sk_buff *skb, rth->rt_gateway = 0; rth->rt_uses_gateway = 0; INIT_LIST_HEAD(&rth->rt_uncached); + RT_CACHE_STAT_INC(in_slow_tot); rth->dst.input = ip_forward; rth->dst.output = ip_output; @@ -1697,8 +1698,6 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr, if (err != 0) goto no_route; - RT_CACHE_STAT_INC(in_slow_tot); - if (res.type == RTN_BROADCAST) goto brd_input; @@ -1767,6 +1766,7 @@ local_input: rth->rt_gateway = 0; rth->rt_uses_gateway = 0; INIT_LIST_HEAD(&rth->rt_uncached); + RT_CACHE_STAT_INC(in_slow_tot); if (res.type == RTN_UNREACHABLE) { rth->dst.input= ip_error; rth->dst.error= -err; |