summaryrefslogtreecommitdiffstats
path: root/examples/nft-rule-ct-expectation-add.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/nft-rule-ct-expectation-add.c')
-rw-r--r--examples/nft-rule-ct-expectation-add.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/examples/nft-rule-ct-expectation-add.c b/examples/nft-rule-ct-expectation-add.c
index 238e224..07c8306 100644
--- a/examples/nft-rule-ct-expectation-add.c
+++ b/examples/nft-rule-ct-expectation-add.c
@@ -69,8 +69,8 @@ static struct nftnl_rule *setup_rule(uint8_t family, const char *table,
exit(EXIT_FAILURE);
}
- nftnl_rule_set(r, NFTNL_RULE_TABLE, table);
- nftnl_rule_set(r, NFTNL_RULE_CHAIN, chain);
+ nftnl_rule_set_str(r, NFTNL_RULE_TABLE, table);
+ nftnl_rule_set_str(r, NFTNL_RULE_CHAIN, chain);
nftnl_rule_set_u32(r, NFTNL_RULE_FAMILY, family);
if (handle != NULL) {
@@ -123,12 +123,11 @@ int main(int argc, char *argv[])
nftnl_batch_begin(mnl_nlmsg_batch_current(batch), seq++);
mnl_nlmsg_batch_next(batch);
- nlh = nftnl_rule_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch),
- NFT_MSG_NEWRULE,
- nftnl_rule_get_u32(r, NFTNL_RULE_FAMILY),
- NLM_F_APPEND|NLM_F_CREATE|NLM_F_ACK,
- seq++);
-
+ nlh = nftnl_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch),
+ NFT_MSG_NEWRULE,
+ nftnl_rule_get_u32(r, NFTNL_RULE_FAMILY),
+ NLM_F_APPEND | NLM_F_CREATE | NLM_F_ACK,
+ seq++);
nftnl_rule_nlmsg_build_payload(nlh, r);
nftnl_rule_free(r);
mnl_nlmsg_batch_next(batch);