summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2021-06-27 18:48:22 -0400
committerDavid S. Miller <davem@davemloft.net>2021-06-29 11:28:21 -0700
commite6a3e4434000de5c36d606e5b5da5f7ba49444bd (patch)
treee9b4fecafa57b087fc3c3692c9c6ac9bf6d07311 /net
parente3ae2365efc14269170a6326477e669332271ab3 (diff)
net: sock: add trace for socket errors
This patch will add tracers to trace inet socket errors only. A user space monitor application can track connection errors indepedent from socket lifetime and do additional handling. For example a cluster manager can fence a node if errors occurs in a specific heuristic. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/sock.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index c30f8f4cbb22..ba1c0f75cd45 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -334,6 +334,16 @@ EXPORT_SYMBOL(__sk_backlog_rcv);
void sk_error_report(struct sock *sk)
{
sk->sk_error_report(sk);
+
+ switch (sk->sk_family) {
+ case AF_INET:
+ fallthrough;
+ case AF_INET6:
+ trace_inet_sk_error_report(sk);
+ break;
+ default:
+ break;
+ }
}
EXPORT_SYMBOL(sk_error_report);