[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100731121316.1adb52c0@nehalam>
Date: Sat, 31 Jul 2010 12:13:16 -0700
From: Stephen Hemminger <shemminger@...tta.com>
To: David Miller <davem@...emloft.net>, jamal <hadi@...erus.ca>
Cc: netdev@...r.kernel.org
Subject: [PATCH] net: ingress filter message limit
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@...tta.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;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists