aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2022-05-09 20:57:41 -0700
committerDavid S. Miller <davem@davemloft.net>2022-05-11 12:44:16 +0100
commiteeee4b77dc52b9128ee450c110caeb92ce3f3f9c (patch)
tree50766a68454ddebad5e7adddf4a236c72e6f5459 /net/core/dev.c
parentnet: remove two BUG() from skb_checksum_help() (diff)
downloadlinux-dev-eeee4b77dc52b9128ee450c110caeb92ce3f3f9c.tar.xz
linux-dev-eeee4b77dc52b9128ee450c110caeb92ce3f3f9c.zip
net: add more debug info in skb_checksum_help()
This is a followup of previous patch. Dumping the stack trace is a good start, but printing basic skb information is probably better. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 918548c73872..91b7e7784da9 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3266,15 +3266,17 @@ int skb_checksum_help(struct sk_buff *skb)
offset = skb_checksum_start_offset(skb);
ret = -EINVAL;
- if (WARN_ON_ONCE(offset >= skb_headlen(skb)))
+ if (WARN_ON_ONCE(offset >= skb_headlen(skb))) {
+ DO_ONCE_LITE(skb_dump, KERN_ERR, skb, false);
goto out;
-
+ }
csum = skb_checksum(skb, offset, skb->len - offset, 0);
offset += skb->csum_offset;
- if (WARN_ON_ONCE(offset + sizeof(__sum16) > skb_headlen(skb)))
+ if (WARN_ON_ONCE(offset + sizeof(__sum16) > skb_headlen(skb))) {
+ DO_ONCE_LITE(skb_dump, KERN_ERR, skb, false);
goto out;
-
+ }
ret = skb_ensure_writable(skb, offset + sizeof(__sum16));
if (ret)
goto out;