]> git.ipfire.org Git - thirdparty/nftables.git/commit
netlink: cmp: shift rhs constant if lhs offset doesn't start on byte boundary
authorFlorian Westphal <fw@strlen.de>
Tue, 4 Aug 2015 12:11:03 +0000 (14:11 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 17 Sep 2015 22:06:09 +0000 (00:06 +0200)
commit048a5e093fde9db515ebc7b14f91bceb6cbd5949
tree6a9192ee071c9d8bbaa05a1a12e1fb810f30fdcc
parenta217645763027da6856efe037c4d3e44abe9d79e
netlink: cmp: shift rhs constant if lhs offset doesn't start on byte boundary

if we have payload(someoffset) == 42, then shift 42 in case someoffset
doesn't start on a byte boundary.

We already insert a mask instruction to only load those bits into
the register that we were interested in, but the cmp will fail without
also adjusting rhs accordingly.

Needs additional patch in reverse direction to undo the shift again
when dumping ruleset.

Signed-off-by: Florian Westphal <fw@strlen.de>
src/netlink_linearize.c