summaryrefslogtreecommitdiffstats
path: root/examples/nft-table-upd.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/nft-table-upd.c')
-rw-r--r--examples/nft-table-upd.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/examples/nft-table-upd.c b/examples/nft-table-upd.c
index 1c7f9b3..247af5d 100644
--- a/examples/nft-table-upd.c
+++ b/examples/nft-table-upd.c
@@ -1,11 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* (C) 2012 by Pablo Neira Ayuso <pablo@netfilter.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
* This software has been sponsored by Sophos Astaro <http://www.sophos.com>
*/
@@ -51,6 +47,8 @@ int main(int argc, char *argv[])
family = NFPROTO_IPV4;
else if (strcmp(argv[1], "ip6") == 0)
family = NFPROTO_IPV6;
+ else if (strcmp(argv[1], "inet") == 0)
+ family = NFPROTO_INET;
else if (strcmp(argv[1], "bridge") == 0)
family = NFPROTO_BRIDGE;
else if (strcmp(argv[1], "arp") == 0)
@@ -59,7 +57,7 @@ int main(int argc, char *argv[])
family = NFPROTO_NETDEV;
else {
fprintf(stderr,
- "Unknown family: ip, ip6, bridge, arp, netdev\n");
+ "Unknown family: ip, ip6, inet, bridge, arp, netdev\n");
exit(EXIT_FAILURE);
}
@@ -76,9 +74,8 @@ int main(int argc, char *argv[])
nftnl_table_set_u32(t, NFTNL_TABLE_FLAGS, flags);
table_seq = seq;
- nlh = nftnl_table_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch),
- NFT_MSG_NEWTABLE, family,
- NLM_F_ACK, seq++);
+ nlh = nftnl_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch),
+ NFT_MSG_NEWTABLE, family, NLM_F_ACK, seq++);
nftnl_table_nlmsg_build_payload(nlh, t);
nftnl_table_free(t);
mnl_nlmsg_batch_next(batch);