Patchwork [libnftables,2/2] examples: nft-set-get: retrieve all sets

login
register
mail settings
Submitter Arturo Borrero
Date Oct. 9, 2013, 10:18 a.m.
Message ID <20131009101812.29759.71506.stgit@nfdev.cica.es>
Download mbox | patch
Permalink /patch/281787/
State Accepted
Headers show

Comments

Arturo Borrero - Oct. 9, 2013, 10:18 a.m.
Other nftables objects are allowed to be dumped with NFPROTO_UNSPEC.
With sets is also possible since kernel patch [b63108a] (netfilter: nf_tables:
allow to dump sets with NFPROTO_UNSPEC).

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 examples/nft-set-get.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/examples/nft-set-get.c b/examples/nft-set-get.c
index 4bc585c..672026f 100644
--- a/examples/nft-set-get.c
+++ b/examples/nft-set-get.c
@@ -74,8 +74,10 @@  int main(int argc, char *argv[])
 		family = NFPROTO_BRIDGE;
 	else if (strcmp(argv[1], "arp") == 0)
 		family = NFPROTO_ARP;
+	else if (strcmp(argv[1], "any") == 0)
+		family = NFPROTO_UNSPEC;
 	else {
-		fprintf(stderr, "Unknown family: ip, ip6, bridge, arp\n");
+		fprintf(stderr, "Unknown family: ip, ip6, bridge, arp, any\n");
 		exit(EXIT_FAILURE);
 	}