Commit 5eabe872 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

net: filter: Use WARN_RATELIMIT

[ Upstream commit 6c4a5cb2 ]

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.
Original-patch-by: default avatarBen Greear <greearb@candelatech.com>
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 46f40799
......@@ -291,7 +291,9 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
mem[f_k] = X;
continue;
default:
WARN_ON(1);
WARN_RATELIMIT(1, "Unknown code:%u jt:%u tf:%u k:%u\n",
fentry->code, fentry->jt,
fentry->jf, fentry->k);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment