diff options
author | Phil Sutter <phil@nwl.cc> | 2024-03-07 13:25:31 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2024-04-11 01:27:07 +0200 |
commit | 410c245e4811d7888daa456547af58d93d1c63b4 (patch) | |
tree | 2fcc85873745dfe6df575fabaa29da81c085a411 /src/obj/ct_expect.c | |
parent | df4e259c0537fff58ecdc7b3ec1546fb2da93968 (diff) |
obj: Call obj_ops::set with legal attributes only
Refer to obj_ops::nftnl_max_attr field value for the maximum supported
attribute value to reject invalid ones upfront.
Consequently drop default cases from callbacks' switches which handle
all supported attributes.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'src/obj/ct_expect.c')
-rw-r--r-- | src/obj/ct_expect.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/obj/ct_expect.c b/src/obj/ct_expect.c index 7e9c5e1..60014dc 100644 --- a/src/obj/ct_expect.c +++ b/src/obj/ct_expect.c @@ -35,8 +35,6 @@ static int nftnl_obj_ct_expect_set(struct nftnl_obj *e, uint16_t type, case NFTNL_OBJ_CT_EXPECT_SIZE: memcpy(&exp->size, data, sizeof(exp->size)); break; - default: - return -1; } return 0; } |