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/chain.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/libnftnl/chain.h') diff --git a/include/libnftnl/chain.h b/include/libnftnl/chain.h index 66626d8..27de302 100644 --- a/include/libnftnl/chain.h +++ b/include/libnftnl/chain.h @@ -29,7 +29,9 @@ enum { NFT_CHAIN_ATTR_PACKETS = 8, NFT_CHAIN_ATTR_HANDLE, NFT_CHAIN_ATTR_TYPE, + __NFT_CHAIN_ATTR_MAX }; +#define NFT_CHAIN_ATTR_MAX (__NFT_CHAIN_ATTR_MAX - 1) bool nft_chain_attr_is_set(const struct nft_chain *c, uint16_t attr); void nft_chain_attr_unset(struct nft_chain *c, uint16_t attr); -- cgit v1.2.3