diff options
Diffstat (limited to 'examples/nft-chain-add.c')
-rw-r--r-- | examples/nft-chain-add.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/examples/nft-chain-add.c b/examples/nft-chain-add.c index e0d889d..5796d10 100644 --- a/examples/nft-chain-add.c +++ b/examples/nft-chain-add.c @@ -67,7 +67,6 @@ int main(int argc, char *argv[]) int ret, family; struct nftnl_chain *t; struct mnl_nlmsg_batch *batch; - int batching; if (argc != 4 && argc != 6) { fprintf(stderr, "Usage: %s <family> <table> <chain> " @@ -93,19 +92,11 @@ int main(int argc, char *argv[]) if (t == NULL) exit(EXIT_FAILURE); - batching = nftnl_batch_is_supported(); - if (batching < 0) { - perror("cannot talk to nfnetlink"); - exit(EXIT_FAILURE); - } - seq = time(NULL); batch = mnl_nlmsg_batch_start(buf, sizeof(buf)); - if (batching) { - nftnl_batch_begin(mnl_nlmsg_batch_current(batch), seq++); - mnl_nlmsg_batch_next(batch); - } + nftnl_batch_begin(mnl_nlmsg_batch_current(batch), seq++); + mnl_nlmsg_batch_next(batch); chain_seq = seq; nlh = nftnl_chain_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch), @@ -115,10 +106,8 @@ int main(int argc, char *argv[]) nftnl_chain_free(t); mnl_nlmsg_batch_next(batch); - if (batching) { - nftnl_batch_end(mnl_nlmsg_batch_current(batch), seq++); - mnl_nlmsg_batch_next(batch); - } + nftnl_batch_end(mnl_nlmsg_batch_current(batch), seq++); + mnl_nlmsg_batch_next(batch); nl = mnl_socket_open(NETLINK_NETFILTER); if (nl == NULL) { |