[PKT_SCHED]: Fix u32 double listing.

Linux Kernel Mailing List <[email protected]> Wed, 09 Feb 2005 04:24:56 +0000
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1539.1.12, 2005/02/08 20:24:56-08:00, [email protected]

	[PKT_SCHED]: Fix u32 double listing.
	
	Signed-off-by: Patrick McHardy <[email protected]>
	Signed-off-by: David S. Miller <[email protected]>



 cls_u32.c |    5 +++++
 1 files changed, 5 insertions(+)


diff -Nru a/net/sched/cls_u32.c b/net/sched/cls_u32.c
--- a/net/sched/cls_u32.c	2005-02-15 11:02:48 -08:00
+++ b/net/sched/cls_u32.c	2005-02-15 11:02:48 -08:00
@@ -70,6 +70,7 @@
 {
 	struct tc_u_hnode	*next;
 	u32			handle;
+	u32			prio;
 	struct tc_u_common	*tp_c;
 	int			refcnt;
 	unsigned		divisor;
@@ -271,6 +272,7 @@
 	root_ht->divisor = 0;
 	root_ht->refcnt++;
 	root_ht->handle = tp_c ? gen_new_htid(tp_c) : 0x80000000;
+	root_ht->prio = tp->prio;
 
 	if (tp_c == NULL) {
 		tp_c = kmalloc(sizeof(*tp_c), GFP_KERNEL);
@@ -534,6 +536,7 @@
 		ht->refcnt = 0;
 		ht->divisor = divisor;
 		ht->handle = handle;
+		ht->prio = tp->prio;
 		ht->next = tp_c->hlist;
 		tp_c->hlist = ht;
 		*arg = (unsigned long)ht;
@@ -606,6 +609,8 @@
 		return;
 
 	for (ht = tp_c->hlist; ht; ht = ht->next) {
+		if (ht->prio != tp->prio)
+			continue;
 		if (arg->count >= arg->skip) {
 			if (arg->fn(tp, (unsigned long)ht, arg) < 0) {
 				arg->stop = 1;