From 410c245e4811d7888daa456547af58d93d1c63b4 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 7 Mar 2024 13:25:31 +0100 Subject: 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 --- src/obj/limit.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/obj/limit.c') diff --git a/src/obj/limit.c b/src/obj/limit.c index 1c54bbc..83cb193 100644 --- a/src/obj/limit.c +++ b/src/obj/limit.c @@ -42,8 +42,6 @@ static int nftnl_obj_limit_set(struct nftnl_obj *e, uint16_t type, case NFTNL_OBJ_LIMIT_FLAGS: memcpy(&limit->flags, data, sizeof(limit->flags)); break; - default: - return -1; } return 0; } -- cgit v1.2.3