"match mark" to route::u32 filter - patch

Thomas Graf tgraf at suug.ch
Fri Nov 7 02:56:19 PST 2014


On 11/05/14 at 03:36pm, Sagi Lowenhardt wrote:
> Hi all,
> 
> attached is a patch to create 'match mark' u32 filters (route/cls)
> In order to do so one should use : `rtnl_u32_add_mark` providing the `cls`,
> mark `value` and `mask`.
> If no selector applied, `rtnl_u32_set_flags` in order to set
> `U32_ATTR_SELECTOR` (otherwise cls addition will be rejected).
> 
> have fun.

Looks great.
Can you provide a signed off line?

> --- /home/sagil/libnl-3.2.25-original/lib/route/cls/u32.c	2014-07-01 13:32:53.000000000 +0300
> +++ u32.c	2014-11-04 12:37:50.802733000 +0200
> -	s = u->cu_selector->d_data;
> +	if (!(u->cu_mask & U32_ATTR_MARK)) {
> +		nl_dump(p, "no-mark\n");
> +	} else {
> +		m = u->cu_mark->d_data;
> +		nl_dump(p, "mark [0x%u] ", m->val);
> +		nl_dump(p, "[0x%u] ", m->mask);

You can put the above nl_dump() onto a single line.




More information about the libnl mailing list