diff options
Diffstat (limited to 'examples/nft-table-add.c')
-rw-r--r-- | examples/nft-table-add.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/examples/nft-table-add.c b/examples/nft-table-add.c index aa6e268..4418a51 100644 --- a/examples/nft-table-add.c +++ b/examples/nft-table-add.c @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) uint32_t portid, seq, table_seq, family; struct nftnl_table *t; struct mnl_nlmsg_batch *batch; - int ret, batching; + int ret; if (argc != 3) { fprintf(stderr, "%s <family> <name>\n", argv[0]); @@ -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); table_seq = seq; family = nftnl_table_get_u32(t, NFTNL_TABLE_FAMILY); @@ -92,10 +84,8 @@ int main(int argc, char *argv[]) nftnl_table_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) { |