mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
Networking: Clean up network status collection and presentation for IPv6
This commit is contained in:
+10
-10
@@ -321,7 +321,7 @@ int ipv4_input(FAR struct net_driver_s *dev)
|
||||
/* This is where the input processing starts. */
|
||||
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.ip.recv++;
|
||||
g_netstats.ipv4.recv++;
|
||||
#endif
|
||||
|
||||
/* Start of IP input header processing code. */
|
||||
@@ -332,8 +332,8 @@ int ipv4_input(FAR struct net_driver_s *dev)
|
||||
/* IP version and header length. */
|
||||
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.ip.drop++;
|
||||
g_netstats.ip.vhlerr++;
|
||||
g_netstats.ipv4.drop++;
|
||||
g_netstats.ipv4.vhlerr++;
|
||||
#endif
|
||||
nlldbg("Invalid IP version or header length: %02x\n", pbuf->vhl);
|
||||
goto drop;
|
||||
@@ -369,8 +369,8 @@ int ipv4_input(FAR struct net_driver_s *dev)
|
||||
}
|
||||
#else /* CONFIG_NET_TCP_REASSEMBLY */
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.ip.drop++;
|
||||
g_netstats.ip.fragerr++;
|
||||
g_netstats.ipv4.drop++;
|
||||
g_netstats.ipv4.fragerr++;
|
||||
#endif
|
||||
nlldbg("IP fragment dropped\n");
|
||||
goto drop;
|
||||
@@ -435,7 +435,7 @@ int ipv4_input(FAR struct net_driver_s *dev)
|
||||
#endif
|
||||
{
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.ip.drop++;
|
||||
g_netstats.ipv4.drop++;
|
||||
#endif
|
||||
goto drop;
|
||||
}
|
||||
@@ -447,8 +447,8 @@ int ipv4_input(FAR struct net_driver_s *dev)
|
||||
/* Compute and check the IP header checksum. */
|
||||
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.ip.drop++;
|
||||
g_netstats.ip.chkerr++;
|
||||
g_netstats.ipv4.drop++;
|
||||
g_netstats.ipv4.chkerr++;
|
||||
#endif
|
||||
nlldbg("Bad IP checksum\n");
|
||||
goto drop;
|
||||
@@ -494,8 +494,8 @@ int ipv4_input(FAR struct net_driver_s *dev)
|
||||
|
||||
default: /* Unrecognized/unsupported protocol */
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.ip.drop++;
|
||||
g_netstats.ip.protoerr++;
|
||||
g_netstats.ipv4.drop++;
|
||||
g_netstats.ipv4.protoerr++;
|
||||
#endif
|
||||
|
||||
nlldbg("Unrecognized IP protocol\n");
|
||||
|
||||
@@ -147,7 +147,7 @@ int ipv6_input(FAR struct net_driver_s *dev)
|
||||
/* This is where the input processing starts. */
|
||||
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.ip.recv++;
|
||||
g_netstats.ipv6.recv++;
|
||||
#endif
|
||||
|
||||
/* Start of IP input header processing code. */
|
||||
@@ -158,8 +158,8 @@ int ipv6_input(FAR struct net_driver_s *dev)
|
||||
/* IP version and header length. */
|
||||
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.ip.drop++;
|
||||
g_netstats.ip.vhlerr++;
|
||||
g_netstats.ipv6.drop++;
|
||||
g_netstats.ipv6.vhlerr++;
|
||||
#endif
|
||||
|
||||
nlldbg("Invalid IPv6 version: %d\n", ipv6->vtc >> 4);
|
||||
@@ -245,7 +245,7 @@ int ipv6_input(FAR struct net_driver_s *dev)
|
||||
ipv6->destipaddr[0] != HTONS(0xff02))
|
||||
{
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.ip.drop++;
|
||||
g_netstats.ipv6.drop++;
|
||||
#endif
|
||||
goto drop;
|
||||
}
|
||||
@@ -283,8 +283,8 @@ int ipv6_input(FAR struct net_driver_s *dev)
|
||||
|
||||
default: /* Unrecognized/unsupported protocol */
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.ip.drop++;
|
||||
g_netstats.ip.protoerr++;
|
||||
g_netstats.ipv6.drop++;
|
||||
g_netstats.ipv6.protoerr++;
|
||||
#endif
|
||||
|
||||
nlldbg("Unrecognized IP protocol: %04x\n", ipv6->proto);
|
||||
|
||||
Reference in New Issue
Block a user