netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sk-filter:  Rate-limit WARNing, print dbg info.
@ 2011-05-17 18:30 greearb
  2011-05-17 18:52 ` Joe Perches
  0 siblings, 1 reply; 19+ messages in thread
From: greearb @ 2011-05-17 18:30 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

A mis-configured filter can spam the logs with
lots of stack traces.  Rate-limit the warnings
and add printout of the bogus filter information.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 afc5837... 8249745... M	net/core/filter.c
 net/core/filter.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index afc5837..8249745 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -409,7 +409,13 @@ load_b:
 			continue;
 		}
 		default:
-			WARN_ON(1);
+			if (net_ratelimit()) {
+				pr_err("filter: Unknown code: %hu jt: %u tf: %u"
+				       " k: %u\n",
+				       fentry->code, (unsigned int)(fentry->jt),
+				       (unsigned int)(fentry->jf), fentry->k);
+				WARN_ON(1);
+			}
 			return 0;
 		}
 	}
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2011-05-26 19:12 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-17 18:30 [PATCH] sk-filter: Rate-limit WARNing, print dbg info greearb
2011-05-17 18:52 ` Joe Perches
2011-05-17 19:23   ` David Miller
2011-05-17 19:34     ` Ben Greear
2011-05-17 19:39       ` David Miller
2011-05-17 19:53       ` Joe Perches
     [not found]         ` <4DD2DB9D.6050306@candelatech.com>
2011-05-17 21:13           ` RFC: Add WARN_RATELIMIT to bug.h (was: Re: [PATCH] sk-filter: Rate-limit WARNing, print dbg info.) Joe Perches
2011-05-21 17:48             ` [PATCH 0/2] Add and use WARN_RATELIMIT Joe Perches
2011-05-21 17:48               ` [PATCH 1/2] bug.h: Add WARN_RATELIMIT Joe Perches
2011-05-21 17:48               ` [PATCH 2/2] net: filter: Use WARN_RATELIMIT Joe Perches
2011-05-26 12:31                 ` [patch] net/core/filter.c: Fix build error Ingo Molnar
2011-05-26 15:31                   ` Joe Perches
2011-05-26 18:38                     ` David Miller
2011-05-26 18:57                       ` Randy Dunlap
2011-05-26 19:00                         ` David Miller
2011-05-26 19:07                       ` Joe Perches
2011-05-26 19:09                       ` Ingo Molnar
2011-05-26 19:12                         ` Ingo Molnar
2011-05-23 21:38               ` [PATCH 0/2] Add and use WARN_RATELIMIT David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).