Re: [PATCH] Use nfmark as a key for u32 classifier

Patrick McHardy
2004-11-09T05:41:40Z

Catalin(ux aka Dino) BOIE wrote:

> Hello!
>
> I am glad to announce a patch for u32 to allow matches on nfmark.
> The patch is non intrusive (few lines).
>
>------------------------------------------------------------------------
>
> 			if
((*(u32*)(ptr+key->off+(off2&key->offmask))^key->val)&key->mask)
{
>--- linux.orig/include/linux/pkt_cls.h	2004-10-19 00:53:07.000000000 +0300
>+++ linux/include/linux/pkt_cls.h	2004-11-05 11:00:27.000000000 +0200
>@@ -208,6 +208,7 @@ struct tc_u32_sel
> 	unsigned char		flags;
> 	unsigned char		offshift;
> 	unsigned char		nkeys;
>+	u32			mark;
>
>
^^ Please put this at the end to avoid breaking compatibility
with old tc binaries. BTW, nfmark if unsigned long, which is
64 bit on 64-bit architectures. Probably not worth fixing though,
everyone else got it wrong too.

>
> 	__u16			offmask;
> 	__u16			off;
>
>

Regards
Patrick