diff options
author | Eric Dumazet <edumazet@google.com> | 2016-08-24 12:01:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-25 19:43:11 -0400 |
commit | 72145a68e4ee116533df49af4b87aca0aacc179c (patch) | |
tree | 31b022a336cbd4cb3554a7b3a46f1e9ec35f6e1c /net | |
parent | e65c332de8a0c9f570847ec490b60effffcd5320 (diff) |
tcp: md5: add LINUX_MIB_TCPMD5FAILURE counter
Adds SNMP counter for drops caused by MD5 mismatches.
The current syslog might help, but a counter is more precise and helps
monitoring.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/proc.c | 1 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 1 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index 9f665b63a927..1ed015e4bc79 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c | |||
@@ -257,6 +257,7 @@ static const struct snmp_mib snmp4_net_list[] = { | |||
257 | SNMP_MIB_ITEM("TCPSpuriousRTOs", LINUX_MIB_TCPSPURIOUSRTOS), | 257 | SNMP_MIB_ITEM("TCPSpuriousRTOs", LINUX_MIB_TCPSPURIOUSRTOS), |
258 | SNMP_MIB_ITEM("TCPMD5NotFound", LINUX_MIB_TCPMD5NOTFOUND), | 258 | SNMP_MIB_ITEM("TCPMD5NotFound", LINUX_MIB_TCPMD5NOTFOUND), |
259 | SNMP_MIB_ITEM("TCPMD5Unexpected", LINUX_MIB_TCPMD5UNEXPECTED), | 259 | SNMP_MIB_ITEM("TCPMD5Unexpected", LINUX_MIB_TCPMD5UNEXPECTED), |
260 | SNMP_MIB_ITEM("TCPMD5Failure", LINUX_MIB_TCPMD5FAILURE), | ||
260 | SNMP_MIB_ITEM("TCPSackShifted", LINUX_MIB_SACKSHIFTED), | 261 | SNMP_MIB_ITEM("TCPSackShifted", LINUX_MIB_SACKSHIFTED), |
261 | SNMP_MIB_ITEM("TCPSackMerged", LINUX_MIB_SACKMERGED), | 262 | SNMP_MIB_ITEM("TCPSackMerged", LINUX_MIB_SACKMERGED), |
262 | SNMP_MIB_ITEM("TCPSackShiftFallback", LINUX_MIB_SACKSHIFTFALLBACK), | 263 | SNMP_MIB_ITEM("TCPSackShiftFallback", LINUX_MIB_SACKSHIFTFALLBACK), |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 436d978c6c39..ad41e8ecf796 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1169,6 +1169,7 @@ static bool tcp_v4_inbound_md5_hash(const struct sock *sk, | |||
1169 | NULL, skb); | 1169 | NULL, skb); |
1170 | 1170 | ||
1171 | if (genhash || memcmp(hash_location, newhash, 16) != 0) { | 1171 | if (genhash || memcmp(hash_location, newhash, 16) != 0) { |
1172 | NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMD5FAILURE); | ||
1172 | net_info_ratelimited("MD5 Hash failed for (%pI4, %d)->(%pI4, %d)%s\n", | 1173 | net_info_ratelimited("MD5 Hash failed for (%pI4, %d)->(%pI4, %d)%s\n", |
1173 | &iph->saddr, ntohs(th->source), | 1174 | &iph->saddr, ntohs(th->source), |
1174 | &iph->daddr, ntohs(th->dest), | 1175 | &iph->daddr, ntohs(th->dest), |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index ac0ed7bda406..e4f55683af31 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -671,6 +671,7 @@ static bool tcp_v6_inbound_md5_hash(const struct sock *sk, | |||
671 | NULL, skb); | 671 | NULL, skb); |
672 | 672 | ||
673 | if (genhash || memcmp(hash_location, newhash, 16) != 0) { | 673 | if (genhash || memcmp(hash_location, newhash, 16) != 0) { |
674 | NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMD5FAILURE); | ||
674 | net_info_ratelimited("MD5 Hash %s for [%pI6c]:%u->[%pI6c]:%u\n", | 675 | net_info_ratelimited("MD5 Hash %s for [%pI6c]:%u->[%pI6c]:%u\n", |
675 | genhash ? "failed" : "mismatch", | 676 | genhash ? "failed" : "mismatch", |
676 | &ip6h->saddr, ntohs(th->source), | 677 | &ip6h->saddr, ntohs(th->source), |