summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2013-04-19 10:45:52 +0000
committerDavid S. Miller <davem@davemloft.net>2013-04-19 17:57:49 -0400
commitc846ad9b880ece01bb4d8d07ba917734edf0324f (patch)
tree93c3e6e09b134a53d0c9f696d1a7ca3a5f438e3a /net
parentb261c20fe089859cc43642e7006921498327fe3d (diff)
downloadop-kernel-dev-c846ad9b880ece01bb4d8d07ba917734edf0324f.zip
op-kernel-dev-c846ad9b880ece01bb4d8d07ba917734edf0324f.tar.gz
net: rate-limit warn-bad-offload splats.
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>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index e7d68ed..b24ab0e9 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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);
OpenPOWER on IntegriCloud