net: ingress filter message limit
Subsystems (2)
PATCH 1/1 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 <[email protected]>
net/core/dev.c +4 -4
@@ -2646,10 +2646,10 @@ static int ing_filter(struct sk_buff *skint 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 ; }
From: Stephen Hemminger <[email protected]>
Date: Sat, 31 Jul 2010 12:13:16 -0700
Quoted 5 lines
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 <[email protected]>
Applied, thanks Stephen.