diff options
author | Ben Greear <greearb@candelatech.com> | 2013-04-19 10:45:52 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-01 09:41:10 -0700 |
commit | 4087320fd8d0164c4b53fe5f9c26c0d3eaba7d2d (patch) | |
tree | eec3227d92d224f68f1902f866bef7fa1613c8d2 /net | |
parent | 7575f50ffc847587909648242efdfd0951eb27b9 (diff) | |
download | lwn-4087320fd8d0164c4b53fe5f9c26c0d3eaba7d2d.tar.gz lwn-4087320fd8d0164c4b53fe5f9c26c0d3eaba7d2d.zip |
net: rate-limit warn-bad-offload splats.
[ Upstream commit c846ad9b880ece01bb4d8d07ba917734edf0324f ]
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 <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index a8cffb43e90c..dd12421b9e85 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1895,6 +1895,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); |