Re: [PATCH] xt_connmark: Add bit mapping for bit-shift operation.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 06, 2018 at 11:14:12AM +0200, Florian Westphal wrote:
> Jack Ma <jack.ma@xxxxxxxxxxxxxxxxxxx> wrote:
> > With the additiona of bit-shift operations, we are able
> > to shift ct/skbmark based on user requirements. However,
> > this change might also cause the most left/right hand-
> > side mark to be accidentially lost during shift operations.
> > 
> > This patch adds the ability to 'grep' ceratin bits based
> > on ctmask or nfmask out of the original mark. Then apply
> > shift operations to achieve a new mapping between ctmark
> > and skb->mark.
> > 
> > For example.
> > 
> > If someone would like save the fourth F bits of ctmark 0xFFF(F)000F
> > into the seventh hexadecimal (0) skb->mark 0xABC000(0)E.
> > 
> > new_targetmark = (ctmark & ctmask) >> 12;
> > (new) skb->mark = (skb->mark &~nfmask) ^
> >                    new_targetmark;
> > 
> > This will preserve the other bits that are not related to
> > this operation.
> > 
> > Reviewed-by: Florian Westphal <fw@xxxxxxxxx>
> 
> I don't recall having seen this patch before.
> 
> That being said, it looks ok to me.
> 
> You might have mentioned that this patch is for 'nf' tree, after
> having merged -next, as this patch changes user-visible behaviour
> (which should be fine in this case as the original change isn't part
>  of 4.16).

Applied to nf.git including the Fixes: tag.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux