]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: print count variable in normal set listings
authorFlorian Westphal <fw@strlen.de>
Tue, 8 Apr 2025 14:21:31 +0000 (16:21 +0200)
committerFlorian Westphal <fw@strlen.de>
Sun, 22 Jun 2025 19:40:36 +0000 (21:40 +0200)
commit8ff87c8fd483eb3fdab5839cccaf100b593fe92e
tree0164551e8546857f5cb240cd35c899429732321e
parent6063a4644746d12bebb39f3ca93e76de6392f5ec
src: print count variable in normal set listings

Also print the number of allocated set elements if the set provided
an upper size limit and there is at least one element.

Example:

table ip t {
   set s {
       type ipv4_addr
       size 65535      # count 1
       flags dynamic
       counter
       elements = { 1.1.1.1 counter packets 1 bytes 11 }
   }
   ...

JSON output is unchanged as this only has informational purposes.

This change breaks tests, followup patch addresses this.

Suggested-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
include/rule.h
src/netlink.c
src/rule.c