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

Sagi Lowenhardt sagil at infinidat.com
Mon Nov 10 07:51:41 PST 2014


attached the patch with 'rtnl_u32_del_mark' option.
also fixed Thomas comment.

On Fri, Nov 7, 2014 at 12:56 PM, Thomas Graf <tgraf at suug.ch> wrote:
> 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.
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: u32.patch
Type: text/x-patch
Size: 4925 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20141110/75640ae9/attachment.bin>


More information about the libnl mailing list