lartc.org : Linux Advanced Routing & Traffic Control
(Answer) (Category) lartc.org FAQ :
sch_prio.c and sch_csz.c 2.4.20 patches for correct filter destroying
Update : these patches made it into kernel 2.4.21
[LARTC] sch_prio.c and sch_csz.c 2.4.20 patches for correct filter destroying
From: "Dimitry V. Ketov"
To:

Recently I've posted these patches in lkml and netdev mailing lists. Just repeating them here if someone is interesting: sch_prio.c and sch_csz.c do not destroy their filter lists, when someone deletes qdisc from interface without explicit filter deleting. So here is the patches. :)

--- linux-2.4.20/net/sched/sch_prio.c   Sat Aug  3 04:39:46 2002
+++ linux/net/sched/sch_prio.c  Thu Apr 10 17:52:55 2003
@@ -158,11 +158,19 @@
 {
        int prio;
        struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+       struct tcf_proto *tp;
 
        for (prio=0; priobands; prio++) {
                qdisc_destroy(q->queues[prio]);
                q->queues[prio] = &noop_qdisc;
        }
+
+       while((tp = q->filter_list) != NULL)
+       {
+               q->filter_list = tp->next;
+               tp->ops->destroy(tp);
+       }
+
        MOD_DEC_USE_COUNT;
 }

--- linux-2.4.20/net/sched/sch_csz.c    Fri Dec 21 20:42:06 2001
+++ linux/net/sched/sch_csz.c   Fri Apr 11 12:33:08 2003
@@ -749,6 +749,15 @@
 static void
 csz_destroy(struct Qdisc* sch)
 {
+       struct csz_sched_data *q = (struct csz_sched_data *)sch->data;
+       struct tcf_proto *tp;
+
+       while((tp = q->filter_list) != NULL)
+       {
+               q->filter_list = tp->next;
+               tp->ops->destroy(tp);
+       }
+
        MOD_DEC_USE_COUNT;
 }

stef.coene@docum.org
[Append to This Answer]
Previous: (Category) Using TC in MPC8250
Next: (Answer) How to find the NIC Capacity / Bandwidth ?
This document is: http://qos.dyndns.org:3389/cgi-bin/fom?file=56
[Search] [Appearance]
This is a Faq-O-Matic 2.719.