]> git.ipfire.org Git - thirdparty/ipset.git/commit
ipset: fix json output format for IPSET_OPT_IP
authorZ. Liu <liuzx@knownsec.com>
Mon, 20 May 2024 14:23:40 +0000 (22:23 +0800)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Wed, 5 Jun 2024 06:25:45 +0000 (08:25 +0200)
commit776f37405da713d3d5ad3908dd9aee4f50c1b1f9
treec832ed511bb7469b16d91eeddea2ad7d4554565b
parented47b815a0d2ca9fc3bd4af5207a5d95d66d54ba
ipset: fix json output format for IPSET_OPT_IP

IPSET_OPT_IP should be quoted to be a well formed json file, otherwise see
following bad example (range is not quoted):

  # ipset create foo bitmap:ip range 192.168.0.0/16
  # ipset list -o json foo
  [
    {
      "name" : "foo",
      "type" : "bitmap:ip",
      "revision" : 3,
      "header" : {
        "range" : 192.168.0.0-192.168.255.255,
        "memsize" : 8280,
        "references" : 0,
        "numentries" : 0
      },
      "members" : [
      ]
    }
  ]

Signed-off-by: Z. Liu <liuzx@knownsec.com>
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
lib/print.c