diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2015-06-25 09:29:20 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2015-06-25 09:29:20 +0200 |
commit | 0c7e18edb07ed205e7087b73a85fa692f45003ab (patch) | |
tree | 4455fd109bcdd539e47234e74ce158b0269f213d /lib/session.c | |
parent | eb9af8fe6d4776242fea84f5228b46d903539146 (diff) |
Add element count to all set types header
It is better to list the set elements for all set types, thus the
header information is uniform. Element counts are therefore added
to the bitmap and list types.
Diffstat (limited to 'lib/session.c')
-rw-r--r-- | lib/session.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/session.c b/lib/session.c index 2650755..95c253e 100644 --- a/lib/session.c +++ b/lib/session.c @@ -931,7 +931,7 @@ list_create(struct ipset_session *session, struct nlattr *nla[]) safe_dprintf(session, ipset_print_number, IPSET_OPT_MEMSIZE); safe_snprintf(session, "\nReferences: "); safe_dprintf(session, ipset_print_number, IPSET_OPT_REFERENCES); - if (MATCH_TYPENAME(type->name , "hash:")) { + if (ipset_data_test(data, IPSET_OPT_ELEMENTS)) { safe_snprintf(session, "\nNumber of entries: "); safe_dprintf(session, ipset_print_number, IPSET_OPT_ELEMENTS); } @@ -945,7 +945,7 @@ list_create(struct ipset_session *session, struct nlattr *nla[]) safe_snprintf(session, "</memsize>\n<references>"); safe_dprintf(session, ipset_print_number, IPSET_OPT_REFERENCES); safe_snprintf(session, "</references>\n"); - if (MATCH_TYPENAME(type->name , "hash:")) { + if (ipset_data_test(data, IPSET_OPT_ELEMENTS)) { safe_snprintf(session, "<numentries>"); safe_dprintf(session, ipset_print_number, IPSET_OPT_ELEMENTS); safe_snprintf(session, "</numentries>\n"); |