From d4aea11c6a7674e4290dc71a4ac93c1d5be7240d Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Tue, 6 Jul 2010 05:57:22 +0200 Subject: netlink: fix creation of base chains with hooknum and priority 0 Base chains with both a hook number and priority of zero are created as regular chains. Fix by adding a BASECHAIN flag indicating that the chain should be created as a base chain. Signed-off-by: Patrick McHardy --- include/rule.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/rule.h b/include/rule.h index 97543072..23171ffb 100644 --- a/include/rule.h +++ b/include/rule.h @@ -78,11 +78,21 @@ extern void table_free(struct table *table); extern void table_add_hash(struct table *table); extern struct table *table_lookup(const struct handle *h); +/** + * enum chain_flags - chain flags + * + * @CHAIN_F_BASECHAIN: chain is a base chain + */ +enum chain_flags { + CHAIN_F_BASECHAIN = 0x1, +}; + /** * struct chain - nftables chain * * @list: list node in table list * @handle: chain handle + * @flags: chain flags * @hooknum: hook number (base chains) * @priority: hook priority (base chains) * @rules: rules contained in the chain @@ -90,6 +100,7 @@ extern struct table *table_lookup(const struct handle *h); struct chain { struct list_head list; struct handle handle; + uint32_t flags; unsigned int hooknum; unsigned int priority; struct scope scope; -- cgit v1.2.3