summaryrefslogtreecommitdiffstats
path: root/examples/nft-chain-del.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/nft-chain-del.c')
-rw-r--r--examples/nft-chain-del.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/examples/nft-chain-del.c b/examples/nft-chain-del.c
index e99bb8a..09a4718 100644
--- a/examples/nft-chain-del.c
+++ b/examples/nft-chain-del.c
@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
struct nlmsghdr *nlh;
uint32_t portid, seq, chain_seq;
struct nftnl_chain *t;
- int ret, family, batching;
+ int ret, family;
if (argc != 4) {
fprintf(stderr, "Usage: %s <family> <table> <chain>\n",
@@ -69,19 +69,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),
@@ -91,10 +83,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) {