From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, Amos Kong <akong@redhat.com>
Cc: qemu-devel@nongnu.org,
Dmitry Krivenok <krivenok.dmitry@gmail.com>,
Anthony Liguori <aliguori@amazon.com>
Subject: Re: [Qemu-devel] [PULL 4/4] net: disallow to specify multicast MAC address
Date: Fri, 18 Oct 2013 10:39:24 -0600 [thread overview]
Message-ID: <5261643C.70004@redhat.com> (raw)
In-Reply-To: <20131018163425.GA29516@stefanha-thinkpad.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 647 bytes --]
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-10-18 16:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-18 13:35 [Qemu-devel] [PULL 0/4] Net patches Stefan Hajnoczi
2013-10-18 13:35 ` [Qemu-devel] [PULL 1/4] net: update nic info during device reset Stefan Hajnoczi
2013-10-18 13:35 ` [Qemu-devel] [PULL 2/4] net/e1000: update network information when macaddr is changed in guest Stefan Hajnoczi
2013-10-18 13:35 ` [Qemu-devel] [PULL 3/4] net/rtl8139: " Stefan Hajnoczi
2013-10-18 13:35 ` [Qemu-devel] [PULL 4/4] net: disallow to specify multicast MAC address Stefan Hajnoczi
2013-10-18 14:56 ` Amos Kong
2013-10-18 16:34 ` Stefan Hajnoczi
2013-10-18 16:39 ` Eric Blake [this message]
2013-10-18 16:41 ` Stefan Hajnoczi
2013-10-18 17:37 ` Dmitry Krivenok
2013-10-18 20:08 ` Dmitry Krivenok
2013-10-22 9:21 ` Amos Kong
2013-10-22 9:51 ` Dmitry Krivenok
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5261643C.70004@redhat.com \
--to=eblake@redhat.com \
--cc=akong@redhat.com \
--cc=aliguori@amazon.com \
--cc=krivenok.dmitry@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.