浏览代码

[IPv6] SNMP: Increment OutNoRoutes when connecting to unreachable network

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>
Mitsuru Chinen 17 年之前
父节点
当前提交
ca46f9c834
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      net/ipv6/ip6_output.c

+ 2 - 0
net/ipv6/ip6_output.c

@@ -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;