set the family attribute on the chain

This commit is contained in:
Paul Chambers 2019-10-01 01:12:10 -07:00
parent 2a496a1c1c
commit dcad93615f
1 changed files with 4 additions and 4 deletions

View File

@ -1354,10 +1354,10 @@ chain_op(enum nf_tables_msg_types op, uint16_t family, const char * table,
log_error("out of memory: %m"); log_error("out of memory: %m");
result = -2; result = -2;
} else { } else {
nftnl_chain_set(chain, NFTNL_CHAIN_TABLE, table); nftnl_chain_set_u32(chain, NFTNL_CHAIN_FAMILY, family);
nftnl_chain_set(chain, NFTNL_CHAIN_NAME, name); nftnl_chain_set(chain, NFTNL_CHAIN_TABLE, table);
if (op == NFT_MSG_NEWCHAIN) nftnl_chain_set(chain, NFTNL_CHAIN_NAME, name);
{ if (op == NFT_MSG_NEWCHAIN) {
nftnl_chain_set_str(chain, NFTNL_CHAIN_TYPE, type); nftnl_chain_set_str(chain, NFTNL_CHAIN_TYPE, type);
nftnl_chain_set_u32(chain, NFTNL_CHAIN_HOOKNUM, hooknum); nftnl_chain_set_u32(chain, NFTNL_CHAIN_HOOKNUM, hooknum);
nftnl_chain_set_s32(chain, NFTNL_CHAIN_PRIO, priority); nftnl_chain_set_s32(chain, NFTNL_CHAIN_PRIO, priority);