Commit 302af7c6 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: always dump full packets with skb_dump

Currently skb_dump has a restriction to only dump full packet for the
first 5 socket buffers, then only headers will be printed. Remove this
arbitrary and confusing restriction, which is only documented vaguely
("up to") in the comments above the prototype.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 717f2034
...@@ -712,11 +712,10 @@ EXPORT_SYMBOL(kfree_skb_list); ...@@ -712,11 +712,10 @@ EXPORT_SYMBOL(kfree_skb_list);
* *
* Must only be called from net_ratelimit()-ed paths. * Must only be called from net_ratelimit()-ed paths.
* *
* Dumps up to can_dump_full whole packets if full_pkt, headers otherwise. * Dumps whole packets if full_pkt, only headers otherwise.
*/ */
void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt) void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt)
{ {
static atomic_t can_dump_full = ATOMIC_INIT(5);
struct skb_shared_info *sh = skb_shinfo(skb); struct skb_shared_info *sh = skb_shinfo(skb);
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
struct sock *sk = skb->sk; struct sock *sk = skb->sk;
...@@ -725,9 +724,6 @@ void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt) ...@@ -725,9 +724,6 @@ void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt)
int headroom, tailroom; int headroom, tailroom;
int i, len, seg_len; int i, len, seg_len;
if (full_pkt)
full_pkt = atomic_dec_if_positive(&can_dump_full) >= 0;
if (full_pkt) if (full_pkt)
len = skb->len; len = skb->len;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment