Subject: Re: [PATCH] skbedit: allow the user to specify bitmask for mark

From: Antonio Quartulli <[email-masked]>
Date: Mon, 21 Jul 2014 14:08:45 +0200

On 21/07/14 14:04, Sergei Shtylyov wrote:
>> diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c
>> index fcfeeaf..5fca32b 100644
>> --- a/net/sched/act_skbedit.c
>> +++ b/net/sched/act_skbedit.c
>> @@ -43,8 +43,12 @@ static int tcf_skbedit(struct sk_buff *skb, const
>> struct tc_action *a,
>>       if (d->flags & SKBEDIT_F_QUEUE_MAPPING &&
>>           skb->dev->real_num_tx_queues > d->queue_mapping)
>>           skb_set_queue_mapping(skb, d->queue_mapping);
>> -    if (d->flags & SKBEDIT_F_MARK)
>> -        skb->mark = d->mark;
>> +    if (d->flags & SKBEDIT_F_MARK) {
>> +        /* unset all the bits in the mask */
>> +        skb->mark = skb->mark & ~d->mask;
> 
>    Why not 'skb->mark &= ~d->mask;'?

No real reason :) Shall we always use the compressed version of this
operator when possible ?

-- 
Antonio Quartulli