Re: [Qemu-devel] [PATCH] net: avoid to use variable length array in net_client_init()

2019-05-07 Thread Stefano Garzarella
On Mon, May 06, 2019 at 12:54:20PM -0500, Eric Blake wrote: > On 5/3/19 12:06 PM, Stefano Garzarella wrote: > > net_client_init() uses a variable length array to store the prefix > > of 'ipv6-net' parameter (e.g. if ipv6-net=fec0::0/64, the prefix > > is 'fec0::0'). > > Since the IPv6 prefix can be

Re: [Qemu-devel] [PATCH] net: avoid to use variable length array in net_client_init()

2019-05-06 Thread Eric Blake
On 5/3/19 12:06 PM, Stefano Garzarella wrote: > net_client_init() uses a variable length array to store the prefix > of 'ipv6-net' parameter (e.g. if ipv6-net=fec0::0/64, the prefix > is 'fec0::0'). > Since the IPv6 prefix can be at most as long as an IPv6 address, > we can use an array with fixed

Re: [Qemu-devel] [PATCH] net: avoid to use variable length array in net_client_init()

2019-05-06 Thread Stefano Garzarella
On Mon, May 06, 2019 at 03:23:08PM +0200, Markus Armbruster wrote: > Stefano Garzarella writes: > > > net_client_init() uses a variable length array to store the prefix > > of 'ipv6-net' parameter (e.g. if ipv6-net=fec0::0/64, the prefix > > is 'fec0::0'). > > Since the IPv6 prefix can be at most

Re: [Qemu-devel] [PATCH] net: avoid to use variable length array in net_client_init()

2019-05-06 Thread Markus Armbruster
Stefano Garzarella writes: > net_client_init() uses a variable length array to store the prefix > of 'ipv6-net' parameter (e.g. if ipv6-net=fec0::0/64, the prefix > is 'fec0::0'). > Since the IPv6 prefix can be at most as long as an IPv6 address, > we can use an array with fixed size equals to IN

[Qemu-devel] [PATCH] net: avoid to use variable length array in net_client_init()

2019-05-03 Thread Stefano Garzarella
net_client_init() uses a variable length array to store the prefix of 'ipv6-net' parameter (e.g. if ipv6-net=fec0::0/64, the prefix is 'fec0::0'). Since the IPv6 prefix can be at most as long as an IPv6 address, we can use an array with fixed size equals to INET6_ADDRSTRLEN. Signed-off-by: Stefano