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@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
e2e0c7c9dd
Коммит
de38483010
|
@ -2646,10 +2646,10 @@ static int ing_filter(struct sk_buff *skb)
|
||||||
int result = TC_ACT_OK;
|
int result = TC_ACT_OK;
|
||||||
struct Qdisc *q;
|
struct Qdisc *q;
|
||||||
|
|
||||||
if (MAX_RED_LOOP < ttl++) {
|
if (unlikely(MAX_RED_LOOP < ttl++)) {
|
||||||
printk(KERN_WARNING
|
if (net_ratelimit())
|
||||||
"Redir loop detected Dropping packet (%d->%d)\n",
|
pr_warning( "Redir loop detected Dropping packet (%d->%d)\n",
|
||||||
skb->skb_iif, dev->ifindex);
|
skb->skb_iif, dev->ifindex);
|
||||||
return TC_ACT_SHOT;
|
return TC_ACT_SHOT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче