Skip to contentSkip to conversation

net: Only store high 16 bits of kernel generated filter priorities

PATCH Applied Robert Love 2 participants 2 messages May 2, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: Only store high 16 bits of kernel generated filter priorities

The kernel should only be using the high 16 bits of a kernel generated priority. Filter priorities in all other cases only use the upper 16 bits of the u32 'prio' field of 'struct tcf_proto', but when the kernel generates the priority of a filter is saves all 32 bits which can result in incorrect lookup failures when a filter needs to be deleted or modified.

---

 net/sched/cls_api.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sched/cls_api.c +1 -1
index 173fcc4..0759f32 100644
@@ -254,7 +254,7 @@ replay:
 		}
 		tp->ops = tp_ops;
 		tp->protocol = protocol;
-		tp->prio = nprio ? : tcf_auto_prio(*back);
+		tp->prio = nprio ? : TC_H_MAJ(tcf_auto_prio(*back));
 		tp->q = q;
 		tp->classify = tp_ops->classify;
 		tp->classid = parent;
maintainer Applied
#1 lore raw

From: Robert Love <[email protected]>
Date: Sat, 02 May 2009 13:43:20 -0700

Quoted 8 lines

The kernel should only be using the high 16 bits of a kernel generated priority. Filter priorities in all other cases only use the upper 16 bits of the u32 'prio' field of 'struct tcf_proto', but when the kernel generates the priority of a filter is saves all 32 bits which can result in incorrect lookup failures when a filter needs to be deleted or modified.

Applied, thanks Robert!