From 584bdf8cbdf6f277c2a00e083257ee75687cf6f4 Mon Sep 17 00:00:00 2001 From: Wei Dong Date: Thu, 31 May 2007 22:49:28 -0700 Subject: [IPV4]: Fix "ipOutNoRoutes" counter error for TCP and UDP Signed-off-by: Wei Dong Signed-off-by: David S. Miller --- net/ipv4/udp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'net/ipv4/udp.c') diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 4c7e95fa090..5da703e699d 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -722,8 +722,11 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, .dport = dport } } }; security_sk_classify_flow(sk, &fl); err = ip_route_output_flow(&rt, &fl, sk, 1); - if (err) + if (err) { + if (err == -ENETUNREACH) + IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES); goto out; + } err = -EACCES; if ((rt->rt_flags & RTCF_BROADCAST) && -- cgit v1.2.3