]> git.ipfire.org Git - thirdparty/nftables.git/commit
exthdr: fix tcpopt_find_template to use length after mask adjustment
authorFlorian Westphal <fw@strlen.de>
Sun, 21 Nov 2021 22:33:19 +0000 (23:33 +0100)
committerFlorian Westphal <fw@strlen.de>
Wed, 1 Dec 2021 13:12:59 +0000 (14:12 +0100)
commitc10464b84d2fe06e137f2d690e347802fcb50821
tree527bb88d1db24fe942186bd2ed5c893304de2448
parent4a81a04294b3a0eaa033eb85c4660df037baee39
exthdr: fix tcpopt_find_template to use length after mask adjustment

Unify binop handling for ipv6 extension header, ip option and tcp option
processing.

Pass the real offset and length expected, not the one used in the kernel.
This was already done for extension headers and ip options, but tcp
option parsing did not do this.

This was fine before because no existing tcp option template
had a non-byte sized member.

With mptcp addition this isn't the case anymore, subtype field is
only 4 bits wide, but tcp option delinearization passed 8bits instead.

Pass the offset and mask delta, just like ip option/ipv6 exthdr.

This makes nft show 'tcp option mptcp subtype 1' instead of
'tcp option mptcp unknown & 240 == 16'.

Signed-off-by: Florian Westphal <fw@strlen.de>
include/tcpopt.h
src/exthdr.c
src/tcpopt.c