qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Dmitry Krivenok <krivenok.dmitry@gmail.com>,
	qemu-devel@nongnu.org, Anthony Liguori <aliguori@amazon.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] net: disallow to specify multicast MAC address
Date: Thu, 17 Oct 2013 09:19:47 -0600	[thread overview]
Message-ID: <52600013.4060704@redhat.com> (raw)
In-Reply-To: <CAJN_NGZ_CosR42CkUiPMd56DW2x1P6gCUAroyib62Howy1OuFA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 748 bytes --]

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 <krivenok.dmitry@gmail.com>
> ---

>  }
> +
> +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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

  reply	other threads:[~2013-10-17 15:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-17 15:06 [Qemu-devel] [PATCH] net: disallow to specify multicast MAC address Dmitry Krivenok
2013-10-17 15:19 ` Eric Blake [this message]
2013-10-17 18:44   ` Dmitry Krivenok
2013-10-18 11:25 ` Stefan Hajnoczi
2013-10-18 16:40 ` Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2013-10-17 11:07 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=52600013.4060704@redhat.com \
    --to=eblake@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).