qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCHv4 2/2] slirp: Allow disabling IPv4 or IPv6


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCHv4 2/2] slirp: Allow disabling IPv4 or IPv6
Date: Mon, 28 Mar 2016 09:12:04 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1

On 03/24/2016 05:34 PM, Samuel Thibault wrote:
> Add ipv4 and ipv6 boolean options, so the user can setup IPv4-only and
> IPv6-only network environments.
> 
> Signed-off-by: Samuel Thibault <address@hidden>
> 
> ---
> 

> @@ -812,10 +822,18 @@ int net_init_slirp(const NetClientOptions *opts, const 
> char *name,
>      int ret;
>      const NetdevUserOptions *user;
>      const char **dnssearch;
> +    int ipv4 = 1, ipv6 = 1;

These should be bool, and set to true.

>  
>      assert(opts->type == NET_CLIENT_OPTIONS_KIND_USER);
>      user = opts->u.user.data;
>  
> +    if ((user->has_ipv6 && user->ipv6 && !user->has_ipv4)
> +            || (user->has_ipv4 && !user->ipv4))
> +        ipv4 = 0;

Inconsistent with current qemu style.  Should be:

    if ((user->has_ipv6 && user->ipv6 && !user->has_ipv4) ||
        (user->has_ipv4 && !user->ipv4)) {
        ipv4 = false;
    }

In particular, the missing {} (should) fail ./scripts/checkpatch.pl.

> +    if ((user->has_ipv4 && user->ipv4 && !user->has_ipv6)
> +            || (user->has_ipv6 && !user->ipv6))
> +        ipv6 = 0;

More missing {} and unusual indentation.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]