patch-2.1.102 linux/net/sched/cls_api.c

Next file: linux/net/sched/cls_fw.c
Previous file: linux/net/sched/Config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.101/linux/net/sched/cls_api.c linux/net/sched/cls_api.c
@@ -114,6 +114,7 @@
 	u32 protocol = TC_H_MIN(t->tcm_info);
 	u32 prio = TC_H_MAJ(t->tcm_info);
 	u32 nprio = prio;
+	u32 parent = t->tcm_parent;
 	struct device *dev;
 	struct Qdisc  *q;
 	struct tcf_proto **back, **chain;
@@ -141,9 +142,10 @@
 		return -ENODEV;
 
 	/* Find qdisc */
-	if (!t->tcm_parent)
+	if (!parent) {
 		q = dev->qdisc_sleeping;
-	else if ((q = qdisc_lookup(dev, TC_H_MAJ(t->tcm_parent))) == NULL)
+		parent = q->handle;
+	} else if ((q = qdisc_lookup(dev, TC_H_MAJ(t->tcm_parent))) == NULL)
 		return -EINVAL;
 
 	/* Is it classful? */
@@ -151,8 +153,8 @@
 		return -EINVAL;
 
 	/* Do we search for filter, attached to class? */
-	if (TC_H_MIN(t->tcm_parent)) {
-		cl = cops->get(q, t->tcm_parent);
+	if (TC_H_MIN(parent)) {
+		cl = cops->get(q, parent);
 		if (cl == 0)
 			return -ENOENT;
 	}
@@ -203,7 +205,7 @@
 		tp->prio = nprio ? : tcf_auto_prio(*back, prio);
 		tp->q = q;
 		tp->classify = tp_ops->classify;
-		tp->classid = t->tcm_parent;
+		tp->classid = parent;
 		err = tp_ops->init(tp);
 		if (err) {
 			kfree(tp);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov