summaryrefslogtreecommitdiffstats
path: root/src/obj/quota.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2024-03-07 13:25:31 +0100
committerPhil Sutter <phil@nwl.cc>2024-04-11 01:27:07 +0200
commit410c245e4811d7888daa456547af58d93d1c63b4 (patch)
tree2fcc85873745dfe6df575fabaa29da81c085a411 /src/obj/quota.c
parentdf4e259c0537fff58ecdc7b3ec1546fb2da93968 (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/quota.c')
-rw-r--r--src/obj/quota.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/obj/quota.c b/src/obj/quota.c
index a39d552..665d7ca 100644
--- a/src/obj/quota.c
+++ b/src/obj/quota.c
@@ -36,8 +36,6 @@ static int nftnl_obj_quota_set(struct nftnl_obj *e, uint16_t type,
case NFTNL_OBJ_QUOTA_FLAGS:
memcpy(&quota->flags, data, sizeof(quota->flags));
break;
- default:
- return -1;
}
return 0;
}