[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 4/4] net: disallow to specify multicast MAC addre
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PULL 4/4] net: disallow to specify multicast MAC address |
Date: |
Fri, 18 Oct 2013 10:39:24 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 |
On 10/18/2013 10:34 AM, Stefan Hajnoczi wrote:
>>> +
>>> +bool net_macaddr_is_multicast(uint8_t *macaddr)
>>> +{
>>> + return macaddr[0] % 2;
>>> +}
>>
>> Duplicate, we already have is_multicast_ether_addr() in include/net/eth.h
>
> And net_macaddr_is_multicast() is wrong:
> bit 0 is the unicast/multicast bit, not bit 1.
Huh? 'foo % 2' is the same as 'foo & 1' - both check bit 0. But I agree
that the '&' form is a bit easier to reason with, even if the compiler
is smart enough to use the same code for both.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PULL 0/4] Net patches, Stefan Hajnoczi, 2013/10/18
- [Qemu-devel] [PULL 3/4] net/rtl8139: update network information when macaddr is changed in guest, Stefan Hajnoczi, 2013/10/18
- [Qemu-devel] [PULL 2/4] net/e1000: update network information when macaddr is changed in guest, Stefan Hajnoczi, 2013/10/18
- [Qemu-devel] [PULL 4/4] net: disallow to specify multicast MAC address, Stefan Hajnoczi, 2013/10/18
- Re: [Qemu-devel] [PULL 4/4] net: disallow to specify multicast MAC address, Dmitry Krivenok, 2013/10/18
- Re: [Qemu-devel] [PULL 4/4] net: disallow to specify multicast MAC address, Amos Kong, 2013/10/22
- Re: [Qemu-devel] [PULL 4/4] net: disallow to specify multicast MAC address, Dmitry Krivenok, 2013/10/22
[Qemu-devel] [PULL 1/4] net: update nic info during device reset, Stefan Hajnoczi, 2013/10/18