[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] net: disallow to specify multicast MAC address
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] net: disallow to specify multicast MAC address |
Date: |
Thu, 17 Oct 2013 09:19:47 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 |
On 10/17/2013 09:06 AM, Dmitry Krivenok wrote:
> Added explicit check of MAC address specified via macaddr option.
> Multicast MAC addresses are no longer allowed.
> This fixes bug #495566.
>
> Signed-off-by: Dmitry V. Krivenok <address@hidden>
> ---
> }
> +
> +bool net_macaddr_is_multicast(uint8_t *macaddr)
> +{
> + return (macaddr[0] % 2) ? true : false;
Personally, I find 'expr ? true : false' rather verbose; why not just:
return macaddr[0] % 2;
But as you're not the first person to do this (a quick grep found two
other offenders in the code base), it's not a strong reason for a respin.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature