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/secmark.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/obj/secmark.c') diff --git a/src/obj/secmark.c b/src/obj/secmark.c index c78e35f..83cd1dc 100644 --- a/src/obj/secmark.c +++ b/src/obj/secmark.c @@ -30,8 +30,6 @@ static int nftnl_obj_secmark_set(struct nftnl_obj *e, uint16_t type, case NFTNL_OBJ_SECMARK_CTX: snprintf(secmark->ctx, sizeof(secmark->ctx), "%s", (const char *)data); break; - default: - return -1; } return 0; } -- cgit v1.2.3