[IPv6] SNMP: Increment OutNoRoutes when connecting to unreachable network
authorMitsuru Chinen <mitch@linux.vnet.ibm.com>
Thu, 6 Dec 2007 06:31:47 +0000 (22:31 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 7 Dec 2007 09:06:30 +0000 (01:06 -0800)
IPv6 stack doesn't increment OutNoRoutes counter when IP datagrams
is being discarded because no route could be found to transmit them
to their destination. IPv6 stack should increment the counter.
Incidentally, IPv4 stack increments that counter in such situation.

Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_output.c

index 86e1835ce4e4bcd71a25a9443f656872ab10c0a8..6338a9c1aa14e2a0f832db6d40d69df678dc09be 100644 (file)
@@ -933,6 +933,8 @@ static int ip6_dst_lookup_tail(struct sock *sk,
        return 0;
 
 out_err_release:
+       if (err == -ENETUNREACH)
+               IP6_INC_STATS_BH(NULL, IPSTATS_MIB_OUTNOROUTES);
        dst_release(*dst);
        *dst = NULL;
        return err;