Skip to content

Commit

Permalink
net: rate-limit warn-bad-offload splats.
Browse files Browse the repository at this point in the history
If one does do something unfortunate and allow a
bad offload bug into the kernel, this the
skb_warn_bad_offload can effectively live-lock the
system, filling the logs with the same error over
and over.

Add rate limitation to this so that box remains otherwise
functional in this case.

Signed-off-by: Ben Greear <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
greearb authored and davem330 committed Apr 19, 2013
1 parent b261c20 commit c846ad9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2148,6 +2148,9 @@ static void skb_warn_bad_offload(const struct sk_buff *skb)
struct net_device *dev = skb->dev;
const char *driver = "";

if (!net_ratelimit())
return;

if (dev && dev->dev.parent)
driver = dev_driver_string(dev->dev.parent);

Expand Down

0 comments on commit c846ad9

Please sign in to comment.