summaryrefslogtreecommitdiffstats
path: root/iptables/nft-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'iptables/nft-cache.c')
-rw-r--r--iptables/nft-cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/iptables/nft-cache.c b/iptables/nft-cache.c
index b7f10ab9..43ac291e 100644
--- a/iptables/nft-cache.c
+++ b/iptables/nft-cache.c
@@ -226,10 +226,11 @@ nft_cache_add_base_chain(struct nft_handle *h, const struct builtin_table *t,
strcmp(type, bc->type))
return -EINVAL;
- if (h->cache->table[t->type].base_chains[hooknum])
+ nc->base_slot = &h->cache->table[t->type].base_chains[hooknum];
+ if (*nc->base_slot)
return -EEXIST;
- h->cache->table[t->type].base_chains[hooknum] = nc;
+ *nc->base_slot = nc;
return 0;
}