Skip to contentSkip to conversation

snmp6: fix title of IPSTATS_MIB_CSUMERRORS

PATCH Superseded Nicolas Dichtel 3 participants 6 messages May 31, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 snmp6: fix title of IPSTATS_MIB_CSUMERRORS

Follow the same convention than other fields, prefix this stat by 'Ip6'.

---

In fact, I wonder if we cannot simply remove this stat for IPv6: there is no checksum in IPv6, so it will always be 0 (and in fact, this stats is only increased in net/ipv4/ip_input.c).

 net/ipv6/proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/proc.c +1 -1
index f3c1ff4..33b97b0 100644
@@ -90,7 +90,7 @@ static const struct snmp_mib snmp6_ipstats_list[] = {
 	SNMP_MIB_ITEM("Ip6OutMcastOctets", IPSTATS_MIB_OUTMCASTOCTETS),
 	SNMP_MIB_ITEM("Ip6InBcastOctets", IPSTATS_MIB_INBCASTOCTETS),
 	SNMP_MIB_ITEM("Ip6OutBcastOctets", IPSTATS_MIB_OUTBCASTOCTETS),
-	SNMP_MIB_ITEM("InCsumErrors", IPSTATS_MIB_CSUMERRORS),
+	SNMP_MIB_ITEM("Ip6InCsumErrors", IPSTATS_MIB_CSUMERRORS),
 	SNMP_MIB_SENTINEL
 };
 
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH v2 1/1 snmp6: fix title of IPSTATS_MIB_CSUMERRORS

Follow the same convention than other fields, prefix this stat by 'Ip6'.

---

In fact, I wonder if we cannot simply remove this stat for IPv6: there is no checksum in IPv6, so it will always be 0 (and in fact, this stats is only increased in net/ipv4/ip_input.c).

v2: add Spotted-by line

 net/ipv6/proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/proc.c +1 -1
index f3c1ff4..33b97b0 100644
@@ -90,7 +90,7 @@ static const struct snmp_mib snmp6_ipstats_list[] = {
 	SNMP_MIB_ITEM("Ip6OutMcastOctets", IPSTATS_MIB_OUTMCASTOCTETS),
 	SNMP_MIB_ITEM("Ip6InBcastOctets", IPSTATS_MIB_INBCASTOCTETS),
 	SNMP_MIB_ITEM("Ip6OutBcastOctets", IPSTATS_MIB_OUTBCASTOCTETS),
-	SNMP_MIB_ITEM("InCsumErrors", IPSTATS_MIB_CSUMERRORS),
+	SNMP_MIB_ITEM("Ip6InCsumErrors", IPSTATS_MIB_CSUMERRORS),
 	SNMP_MIB_SENTINEL
 };
 
Signature · 1 line
1.8.2.1
#2 lore raw
Quoted 9 lines · Nicolas Dichtel

Follow the same convention than other fields, prefix this stat by 'Ip6'.

---

In fact, I wonder if we cannot simply remove this stat for IPv6: there is no checksum in IPv6, so it will always be 0 (and in fact, this stats is only increased in net/ipv4/ip_input.c).

You could put this line in a comment, so that a future reader knows why we do have a hole.

#3 lore raw

PATCH v3 1/1 snmp6: remove IPSTATS_MIB_CSUMERRORS

This stat is not relevant in IPv6, there is no checksum in IPv6 header. Just leave a comment to explain the hole.

---

v3: remove the stat, not relevant in IPv6
remove spotted-by because it was only for the 'wrong' stat name (missing prefix 'Ip6')

v2: add Spotted-by line

 net/ipv6/proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/proc.c +1 -1
index f3c1ff4..51c3285 100644
@@ -90,7 +90,7 @@ static const struct snmp_mib snmp6_ipstats_list[] = {
 	SNMP_MIB_ITEM("Ip6OutMcastOctets", IPSTATS_MIB_OUTMCASTOCTETS),
 	SNMP_MIB_ITEM("Ip6InBcastOctets", IPSTATS_MIB_INBCASTOCTETS),
 	SNMP_MIB_ITEM("Ip6OutBcastOctets", IPSTATS_MIB_OUTBCASTOCTETS),
-	SNMP_MIB_ITEM("InCsumErrors", IPSTATS_MIB_CSUMERRORS),
+	/* IPSTATS_MIB_CSUMERRORS is not relevant in IPv6 (no checksum) */
 	SNMP_MIB_SENTINEL
 };
 
Signature · 1 line
1.8.2.1