]> git.ipfire.org Git - thirdparty/nftables.git/commit
exthdr: prefer raw_type instead of desc->type
authorFlorian Westphal <fw@strlen.de>
Fri, 14 Jul 2023 14:53:57 +0000 (16:53 +0200)
committerFlorian Westphal <fw@strlen.de>
Mon, 17 Jul 2023 19:47:03 +0000 (21:47 +0200)
commit574fa55c2e70449887c7714d7b043f4e8b6d28da
treed5d323e74c8136956632d372ebbae1a9131fa14b
parent58f5f4f4dbde0eeab2705dfe453610d850a632c0
exthdr: prefer raw_type instead of desc->type

On ancient kernels desc can be NULL, because such kernels do not
understand NFTA_EXTHDR_TYPE.

Thus they don't include it in the reverse dump, so the tcp/ip
option gets treated like an ipv6 exthdr, but no matching
description will be found.

This then gives a crash due to the null deref.

Just use the raw value here, this avoid a crash and at least
print *something*, e.g.:

unknown-exthdr unknown & 0xf0 [invalid type] == 0x0 [invalid type]

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