Re: [PATCH] fix json output format for IPSET_OPT_IP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux