]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rule: set internal_location for table and chain
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 30 Aug 2023 15:05:59 +0000 (17:05 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 31 Aug 2023 14:38:14 +0000 (16:38 +0200)
JSON parser does not seem to set on this, better provide a default
location.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/rule.c

index fa4c72adab064fe5ac605a33b3db1364be99be03..bce728ab9b46e67bbbc682ff090b9e0e683acb72 100644 (file)
@@ -705,6 +705,7 @@ struct chain *chain_alloc(void)
        struct chain *chain;
 
        chain = xzalloc(sizeof(*chain));
+       chain->location = internal_location;
        chain->refcnt = 1;
        chain->handle.chain_id = ++chain_id;
        init_list_head(&chain->rules);
@@ -1125,6 +1126,7 @@ struct table *table_alloc(void)
        struct table *table;
 
        table = xzalloc(sizeof(*table));
+       table->location = internal_location;
        init_list_head(&table->chains);
        init_list_head(&table->sets);
        init_list_head(&table->objs);