[Bug 1495] New: set elements missing from json output

bugzilla-daemon at netfilter.org bugzilla-daemon at netfilter.org
Mon Feb 1 15:25:45 CET 2021


https://bugzilla.netfilter.org/show_bug.cgi?id=1495

            Bug ID: 1495
           Summary: set elements missing from json output
           Product: nftables
           Version: unspecified
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: nft
          Assignee: pablo at netfilter.org
          Reporter: 5bbcc2f9 at opayq.com

if I use the wiki example from page
https://wiki.nftables.org/wiki-nftables/index.php/Meters:

% nft add table my_filter_table
% nft add chain my_filter_table my_input_chain {type filter hook input priority
0\;}
% nft add set my_filter_table my_ssh_meter { type ipv4_addr\; flags dynamic \;}
% nft add rule my_filter_table my_input_chain tcp dport 22 ct state new add
@my_ssh_meter { ip saddr limit rate 10/second } accept

the text listing of the ruleset is correct:

% nft list ruleset
table ip my_filter_table {
        set my_ssh_meter {
                type ipv4_addr
                size 65535
                flags dynamic
        }

        chain my_input_chain {
                type filter hook input priority filter; policy accept;
                tcp dport 22 ct state new add @my_ssh_meter { ip saddr limit
rate 10/second } accept
        }
}

the json version of the same thing appears to omit the rate limiting clause:

% nft -j list ruleset
{"nftables": [{"metainfo": {"version": "0.9.8", "release_name": "E.D.S.",
"json_schema_version": 1}}, {"table": {"family": "ip", "name":
"my_filter_table", "handle": 39}}, {"set": {"family": "ip", "name":
"my_ssh_meter", "table": "my_filter_table", "type": "ipv4_addr", "handle": 2,
"size": 65535}}, {"chain": {"family": "ip", "table": "my_filter_table", "name":
"my_input_chain", "handle": 1, "type": "filter", "hook": "input", "prio": 0,
"policy": "accept"}}, {"rule": {"family": "ip", "table": "my_filter_table",
"chain": "my_input_chain", "handle": 3, "expr": [{"match": {"op": "==", "left":
{"payload": {"protocol": "tcp", "field": "dport"}}, "right": 22}}, {"match":
{"op": "in", "left": {"ct": {"key": "state"}}, "right": "new"}}, {"set": {"op":
"add", "elem": {"payload": {"protocol": "ip", "field": "saddr"}}, "set":
"@my_ssh_meter"}}, {"accept": null}]}}]}

As a easy check, the number "10" does not appear in the json output, but does
in the text output.

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20210201/b0289fda/attachment.html>


More information about the netfilter-buglog mailing list