summaryrefslogtreecommitdiffstats
path: root/examples/nft-flowtable-del.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/nft-flowtable-del.c')
-rw-r--r--examples/nft-flowtable-del.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/examples/nft-flowtable-del.c b/examples/nft-flowtable-del.c
index 91e5d3a..c5ce339 100644
--- a/examples/nft-flowtable-del.c
+++ b/examples/nft-flowtable-del.c
@@ -33,7 +33,7 @@ int main(int argc, char *argv[])
struct nlmsghdr *nlh;
uint32_t portid, seq, flowtable_seq;
struct nftnl_flowtable *t;
- int ret, family, batching;
+ int ret, family;
if (argc != 4) {
fprintf(stderr, "Usage: %s <family> <table> <flowtable>\n",
@@ -60,32 +60,22 @@ 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);
flowtable_seq = seq;
- nlh = nftnl_flowtable_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch),
- NFT_MSG_DELFLOWTABLE, family,
- NLM_F_ACK, seq++);
+ nlh = nftnl_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch),
+ NFT_MSG_DELFLOWTABLE, family,
+ NLM_F_ACK, seq++);
nftnl_flowtable_nlmsg_build_payload(nlh, t);
nftnl_flowtable_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) {