* [PATCH] net: ingress filter message limit
@ 2010-07-31 19:13 Stephen Hemminger
2010-08-01 7:33 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2010-07-31 19:13 UTC (permalink / raw)
To: David Miller, jamal; +Cc: netdev
If user misconfigures ingress and causes a redirection loop, don't
overwhelm the log. This is also a error case so make it unlikely.
Found by inspection, luckily not in real system.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/net/core/dev.c 2010-07-31 12:08:00.808476717 -0700
+++ b/net/core/dev.c 2010-07-31 12:09:32.488882593 -0700
@@ -2646,10 +2646,10 @@ static int ing_filter(struct sk_buff *sk
int result = TC_ACT_OK;
struct Qdisc *q;
- if (MAX_RED_LOOP < ttl++) {
- printk(KERN_WARNING
- "Redir loop detected Dropping packet (%d->%d)\n",
- skb->skb_iif, dev->ifindex);
+ if (unlikely(MAX_RED_LOOP < ttl++)) {
+ if (net_ratelimit())
+ pr_warning( "Redir loop detected Dropping packet (%d->%d)\n",
+ skb->skb_iif, dev->ifindex);
return TC_ACT_SHOT;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-08-01 7:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-31 19:13 [PATCH] net: ingress filter message limit Stephen Hemminger
2010-08-01 7:33 ` 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).