]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nft_payload: simplify vlan header handling
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 31 Oct 2019 14:51:21 +0000 (15:51 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 13 Nov 2019 09:41:34 +0000 (10:41 +0100)
commitffbfb5e58c6ccd4f73064f18004a4b93aabfeacd
tree17f8e0e4e81b4657b5082a063f3abad9686b17cb
parent68b0dcfc23e92db79b5a4e7f5872ce8fedcefa66
netfilter: nft_payload: simplify vlan header handling

If the offset is within the ethernet + vlan header size boundary, then
rebuild the ethernet + vlan header and use it to copy the bytes to the
register. Otherwise, subtract the vlan header size from the offset and
fall back to use skb_copy_bits().

There is one corner case though: If the offset plus the length of the
payload instruction goes over the ethernet + vlan header boundary, then,
fetch as many bytes as possible from the rebuilt ethernet + vlan header
and fall back to copy the remaining bytes through skb_copy_bits().

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Florian Westphal <fw@strlen.de>
net/netfilter/nft_payload.c