summaryrefslogtreecommitdiffstats
path: root/include/libnftnl/rule.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2014-02-25 22:27:12 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2014-02-27 10:35:07 +0100
commit41175cec8407da4687493a9f74043656682d470a (patch)
tree0480536d5861270c83edc43908cc9abe5da6eb69 /include/libnftnl/rule.h
parent19c3da8e70d32818b7267fc63b44441295e69567 (diff)
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 <pablo@netfilter.org>
Diffstat (limited to 'include/libnftnl/rule.h')
-rw-r--r--include/libnftnl/rule.h2
1 files changed, 2 insertions, 0 deletions
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);