Skip to contentSkip to conversation

cls_u32 u32_classify() +

PATCH In review Dzianis Kahanovich 2 participants 2 messages Jan 30, 2008 – Jan 31, 2008

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

PATCH 1/1 cls_u32 u32_classify() +

Currently fine u32 "hashkey ... at ..." not work with relative offsets. There are simpliest fix to use "eat".
(sorry, v2)

Signature · 2 lines
WBR,
Denis Kaganovich,  [email protected]  http://mahatma.bspu.unibel.by
net/sched/cls_u32.c +8 -3
diff -pruN linux-2.6.orig/net/sched/cls_u32.c linux-2.6/net/sched/cls_u32.c
@@ -181,11 +181,13 @@ check_terminal:
 
 		ht = n->ht_down;
 		sel = 0;
-		if (ht->divisor)
-			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
 
-		if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT)))
+		if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT))) {
+			if (!ht->divisor)
+				goto next_ht;
+			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
 			goto next_ht;
+		}
 
 		if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) {
 			off2 = n->sel.off + 3;
@@ -198,6 +200,9 @@ check_terminal:
 			off2 = 0;
 		}
 
+		if (ht->divisor && ptr+n->sel.hoff < skb_tail_pointer(skb))
+			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
+
 		if (ptr < skb_tail_pointer(skb))
 			goto next_ht;
 	}
#1 lore raw
Quoted 4 lines · Dzianis Kahanovich

Currently fine u32 "hashkey ... at ..." not work with relative offsets. There are simpliest fix to use "eat".
(sorry, v2)

Hi,
Please send me the commands you are trying to run that motivated this patch.

cheers,
jamal