Skip to content

Commit b60b659

Browse files
stephen hemmingerdavem330
authored andcommitted
net sched: cleanup and rate limit warning
If the user has a bad classification configuration, and gets a packet that goes through too many steps. Chances are more packets will arrive, and the message spew will overrun syslog because it is not rate limited. And because it is not tagged with appropriate priority it can't not be screened. Added the qdisc to the message to try and give some more context when the message does arrive. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 207024b commit b60b659

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎net/sched/sch_api.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,9 +1637,12 @@ int tc_classify(struct sk_buff *skb, struct tcf_proto *tp,
16371637
tp = otp;
16381638

16391639
if (verd++ >= MAX_REC_LOOP) {
1640-
printk("rule prio %u protocol %02x reclassify loop, "
1641-
"packet dropped\n",
1642-
tp->prio&0xffff, ntohs(tp->protocol));
1640+
if (net_ratelimit())
1641+
printk(KERN_NOTICE
1642+
"%s: packet reclassify loop"
1643+
" rule prio %u protocol %02x\n",
1644+
tp->q->ops->id,
1645+
tp->prio & 0xffff, ntohs(tp->protocol));
16431646
return TC_ACT_SHOT;
16441647
}
16451648
skb->tc_verd = SET_TC_VERD(skb->tc_verd, verd);

0 commit comments

Comments
 (0)