diff options
author | Ben Greear | 2013-04-19 05:45:52 -0500 |
---|---|---|
committer | Greg Kroah-Hartman | 2013-05-01 11:46:20 -0500 |
commit | 24fce1108c501a4558f3f62efa956062937febf5 (patch) | |
tree | eda88071076495c8f4c56ebe994c1e601eb1de4e /net | |
parent | 72b1b8da7cb01424cbafd36bf3a7c35215eb4ec7 (diff) | |
download | kernel-video-24fce1108c501a4558f3f62efa956062937febf5.tar.gz kernel-video-24fce1108c501a4558f3f62efa956062937febf5.tar.xz kernel-video-24fce1108c501a4558f3f62efa956062937febf5.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 28b6f97c340..d592214b139 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2018,6 +2018,9 @@ static void skb_warn_bad_offload(const struct sk_buff *skb) | |||
2018 | struct net_device *dev = skb->dev; | 2018 | struct net_device *dev = skb->dev; |
2019 | const char *driver = ""; | 2019 | const char *driver = ""; |
2020 | 2020 | ||
2021 | if (!net_ratelimit()) | ||
2022 | return; | ||
2023 | |||
2021 | if (dev && dev->dev.parent) | 2024 | if (dev && dev->dev.parent) |
2022 | driver = dev_driver_string(dev->dev.parent); | 2025 | driver = dev_driver_string(dev->dev.parent); |
2023 | 2026 | ||