diff options
author | Wei Dong <weidong@cn.fujitsu.com> | 2007-05-31 22:49:28 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-06-03 18:08:50 -0700 |
commit | 584bdf8cbdf6f277c2a00e083257ee75687cf6f4 (patch) | |
tree | ae652e24340134824fe7016adcd99155ec9b2aea /net/ipv4/datagram.c | |
parent | 4fcd6b991685493185c2bb8a76b21aadb658bd76 (diff) |
[IPV4]: Fix "ipOutNoRoutes" counter error for TCP and UDP
Signed-off-by: Wei Dong <weidong@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/datagram.c')
-rw-r--r-- | net/ipv4/datagram.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv4/datagram.c b/net/ipv4/datagram.c index dd02a45d0f67..0301dd468cf4 100644 --- a/net/ipv4/datagram.c +++ b/net/ipv4/datagram.c @@ -50,8 +50,12 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) RT_CONN_FLAGS(sk), oif, sk->sk_protocol, inet->sport, usin->sin_port, sk, 1); - if (err) + if (err) { + if (err == -ENETUNREACH) + IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES); return err; + } + if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) { ip_rt_put(rt); return -EACCES; |