From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWpMj-0006J4-CK for qemu-devel@nongnu.org; Thu, 17 Oct 2013 11:20:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWpMc-0006jc-MU for qemu-devel@nongnu.org; Thu, 17 Oct 2013 11:19:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWpMc-0006jW-Ch for qemu-devel@nongnu.org; Thu, 17 Oct 2013 11:19:50 -0400 Message-ID: <52600013.4060704@redhat.com> Date: Thu, 17 Oct 2013 09:19:47 -0600 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aCdWt1EU4JcOu0KuioJD4fDf3riVa8pIQ" Subject: Re: [Qemu-devel] [PATCH] net: disallow to specify multicast MAC address List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Krivenok , qemu-devel@nongnu.org, Anthony Liguori , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aCdWt1EU4JcOu0KuioJD4fDf3riVa8pIQ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Dmitry V. Krivenok > --- > } > + > +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.= --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --aCdWt1EU4JcOu0KuioJD4fDf3riVa8pIQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSYAATAAoJEKeha0olJ0NqOg8H/1eqApCnuZ5nEu90mqe+/2U+ awUbzLQNlamSb3HXyt+OJAonvzadefr/FfHP5PhN5adXATu2WEQRBQkGeXoLmImk j01grmNjB+zIiHGJhXgfC4kn62z3Q6i1eSaXpTcLoa9AZtywaPfMPSXAnrHs+ufv OMZhqyvs9VlVbu5Gv/j2OHR6WdUHfT4T4PV/N+czDlzNto4JoD34ci1Ndvioax/e u0Q3RlmlBeMUG9w6n/xi7JvyLiQ8VbGohppMvNwzhqFqMw2n1K6fz0rJdh7SN1PC 1Lafaj8t0xZJvjNQ90ljkmqBa4/avF14qVpcDCdZn2Wbg3x230go/ifWwOx3fTE= =UAu/ -----END PGP SIGNATURE----- --aCdWt1EU4JcOu0KuioJD4fDf3riVa8pIQ--