]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: avoid IPPROTO_MAX for array definitions
authorFlorian Westphal <fw@strlen.de>
Tue, 20 Jun 2023 19:52:13 +0000 (21:52 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 21 Jun 2023 15:27:43 +0000 (17:27 +0200)
commite300318ff4688e0a53104cf2f990ccf3fdd36e89
tree3ed101d29a83bf53aafac25008099558b9b20843
parent1d2e22fc0521bcf73ee1f891c291dc1bde47a6bb
src: avoid IPPROTO_MAX for array definitions

ip header can only accomodate 8but value, but IPPROTO_MAX has been bumped
due to uapi reasons to support MPTCP (262, which is used to toggle on
multipath support in tcp).

This results in:
exthdr.c:349:11: warning: result of comparison of constant 263 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare]
if (type < array_size(exthdr_protocols))
            ~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

redude array sizes back to what can be used on-wire.

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