diff options
author | Phil Sutter <phil@nwl.cc> | 2023-12-13 23:49:53 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2024-03-06 15:40:37 +0100 |
commit | 5029136028bff1747860ed770994b8f494c042fc (patch) | |
tree | 5d5b2a294fb00589a9e691617c7eeaaa31b90da1 /src/expr/range.c | |
parent | 4ed45d7bbbb9f914c934af327ee0271bcc909302 (diff) |
expr: Call expr_ops::set with legal types only
Having the new expr_ops::nftnl_max_attr field in place, the valid range
of attribute type values is known now. Reject illegal ones upfront.
Consequently drop the default case from callbacks' switches which handle
all supported attributes.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'src/expr/range.c')
-rw-r--r-- | src/expr/range.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/expr/range.c b/src/expr/range.c index cb3708c..d0c52b9 100644 --- a/src/expr/range.c +++ b/src/expr/range.c @@ -43,8 +43,6 @@ static int nftnl_expr_range_set(struct nftnl_expr *e, uint16_t type, return nftnl_data_cpy(&range->data_from, data, data_len); case NFTNL_EXPR_RANGE_TO_DATA: return nftnl_data_cpy(&range->data_to, data, data_len); - default: - return -1; } return 0; } |