Skip to contentSkip to conversation

net: ingress filter message limit

PATCH Applied Stephen Hemminger 2 participants 2 messages Jul 31, 2010 – Aug 1, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

net/core/dev.c +4 -4
@@ -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;
 	}
 
maintainer Applied
#1 lore raw

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.

Applied, thanks Stephen.