Thanks, please see attachment for the updated patch. Jozsef Kadlecsik <kadlec@xxxxxxxxxxxxx> 于2024年5月23日周四 15:09写道: > > Hello, > > On Mon, 20 May 2024, Zhixu Liu wrote: > > > It 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" : [ > > ] > > } > > ] > > Thank you your patch. Please rework it and use a quoted buffer similarly > to ipset_print_hexnumber() in order to avoid the many "if (env & > IPSET_ENV_QUOTED)" constructs. > > Best regards, > Jozsef > -- > E-mail : kadlec@xxxxxxxxxxxxxxxxx, kadlecsik.jozsef@xxxxxxxxx > PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt > Address : Wigner Research Centre for Physics > H-1525 Budapest 114, POB. 49, Hungary -- Z. Liu
Attachment:
0001-ipset-fix-json-output-format-for-IPSET_OPT_IP.patch
Description: Binary data