]> git.ipfire.org Git - thirdparty/nftables.git/commit
evalute: make vlan pcp updates work
authorFlorian Westphal <fw@strlen.de>
Sat, 19 Apr 2025 11:44:39 +0000 (13:44 +0200)
committerFlorian Westphal <fw@strlen.de>
Mon, 21 Apr 2025 22:53:56 +0000 (00:53 +0200)
commit2c41c82296c70203f4781fb976ee0f05629fba44
tree16e2e101d766abd22a712e2ff15a6482eba8b44e
parent63ed8af82ba0e595c571c5f16257186968ff9833
evalute: make vlan pcp updates work

On kernel side, nft_payload_set_vlan() requires a 2 or 4 byte
write to the vlan header.

As-is, nft emits a 1 byte write:
  [ payload load 1b @ link header + 14 => reg 1 ]
  [ bitwise reg 1 = ( reg 1 & 0x0000001f ) ^ 0x00000020 ]

... which the kernel doesn't support.  Expand all vlan header updates to
a 2 or 4 byte write and update the existing vlan id test case.

Reported-by: Kevin Vigouroux <ke.vigouroux@laposte.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c
tests/shell/testcases/packetpath/vlan_mangling