qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCHv7 1/9] slirp: Adding IPv6, ICMPv6 Echo and NDP a


From: Thomas Huth
Subject: Re: [Qemu-devel] [PATCHv7 1/9] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration
Date: Tue, 9 Feb 2016 20:32:49 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 09.02.2016 17:31, Samuel Thibault wrote:
> Thomas Huth, on Tue 09 Feb 2016 17:14:15 +0100, wrote:
>>> +    return (a.s6_addr[prefix_len / 8] >> (8 - (prefix_len % 8)))
>>> +        == (b.s6_addr[prefix_len / 8] >> (8 - (prefix_len % 8)));
>>
>> checkpatch.pl complains here:
>>
>> ERROR: return is not a function, parentheses are not required
> 
> This is a false positive, there are no outer parentheses here.

Ah, you're right, of course, I haven't looked closely enough, sorry.
Maybe checkpatch.pl could also be silenced by putting the "==" at the
end of the first line instead?

>>> +static void icmp6_send_echoreply(struct mbuf *m, Slirp *slirp, struct ip6 
>>> *ip,
>>> +        struct icmp6 *icmp)
>>> +{
>>> +    struct mbuf *t = m_get(slirp);
>>> +    t->m_len = sizeof(struct ip6) + ntohs(ip->ip_pl);
>>> +    memcpy(t->m_data, m->m_data, t->m_len);
>>> +
>>> +    /* IPv6 Packet */
>>> +    struct ip6 *rip = mtod(t, struct ip6 *);
>>
>> Not sure how strictly this is handled in QEMU, but for proper portable
>> C, variables should be declared at the beginning of a scope, as far as I
>> know.
> 
> AIUI, qemu requires C99, doesn't it?

Ok, you're right again, this is even declared in the HACKING file of
QEMU, so this should be fine, I think.

 Thomas




reply via email to

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