diff options
author | Florian Westphal <fw@strlen.de> | 2023-06-20 21:52:13 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2023-06-21 17:27:43 +0200 |
commit | e300318ff4688e0a53104cf2f990ccf3fdd36e89 (patch) | |
tree | 3ed101d29a83bf53aafac25008099558b9b20843 /include | |
parent | 1d2e22fc0521bcf73ee1f891c291dc1bde47a6bb (diff) |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/rule.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/rule.h b/include/rule.h index b360e261..5cb549c2 100644 --- a/include/rule.h +++ b/include/rule.h @@ -786,7 +786,7 @@ struct timeout_protocol { uint32_t *dflt_timeout; }; -extern struct timeout_protocol timeout_protocol[IPPROTO_MAX]; +extern struct timeout_protocol timeout_protocol[UINT8_MAX + 1]; extern int timeout_str2num(uint16_t l4proto, struct timeout_state *ts); #endif /* NFTABLES_RULE_H */ |