From 41175cec8407da4687493a9f74043656682d470a Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 25 Feb 2014 22:27:12 +0100 Subject: src: early attribute type validation in nft_*_attr_set This allows us to remove the default case in the switch, which show help to spot missing attribute support since gcc will spot a compilation warning. Signed-off-by: Pablo Neira Ayuso --- include/libnftnl/rule.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/libnftnl/rule.h') diff --git a/include/libnftnl/rule.h b/include/libnftnl/rule.h index 4033d3c..13e6c14 100644 --- a/include/libnftnl/rule.h +++ b/include/libnftnl/rule.h @@ -26,7 +26,9 @@ enum { NFT_RULE_ATTR_COMPAT_PROTO, NFT_RULE_ATTR_COMPAT_FLAGS, NFT_RULE_ATTR_POSITION, + __NFT_RULE_ATTR_MAX }; +#define NFT_RULE_ATTR_MAX (__NFT_RULE_ATTR_MAX - 1) void nft_rule_attr_unset(struct nft_rule *r, uint16_t attr); bool nft_rule_attr_is_set(const struct nft_rule *r, uint16_t attr); -- cgit v1.2.3