Received: from eggs.gnu.org ([2001:4830:134:3::10]:53476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXD5N-0005LI-3c for qemu-devel@nongnu.org; Fri, 18 Oct 2013 12:39:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXD5F-0006GT-Bn for qemu-devel@nongnu.org; Fri, 18 Oct 2013 12:39:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXD5F-0006GJ-1Z for qemu-devel@nongnu.org; Fri, 18 Oct 2013 12:39:29 -0400 Message-ID: <5261643C.70004@redhat.com> Date: Fri, 18 Oct 2013 10:39:24 -0600 From: Eric Blake MIME-Version: 1.0 References: <1382103314-21608-1-git-send-email-stefanha@redhat.com> <1382103314-21608-5-git-send-email-stefanha@redhat.com> <20131018145655.GA22563@amosk.info> <20131018163425.GA29516@stefanha-thinkpad.redhat.com> In-Reply-To: <20131018163425.GA29516@stefanha-thinkpad.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="peau6e7dAtDt7SV25gNMJhvu1PosW1dNR" Subject: Re: [Qemu-devel] [PULL 4/4] net: disallow to specify multicast MAC address List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , Amos Kong Cc: qemu-devel@nongnu.org, Dmitry Krivenok , Anthony Liguori This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --peau6e7dAtDt7SV25gNMJhvu1PosW1dNR Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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/et= h.h >=20 > 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --peau6e7dAtDt7SV25gNMJhvu1PosW1dNR 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/ iQEcBAEBCAAGBQJSYWQ8AAoJEKeha0olJ0NqOmgH+webMiZMLBCQ5aUW1bj/ZqvZ E7LNvMVq4KH23JoV+QWjnm8juakw+xN5jwC4Qp1zKsouLxQq84xXjjW9JMNOMfZW ghfCGX8VqpdCkEawP9PFj6hTSa3aPIGkZUc9MAp9GGMNcOK4/bD4mJJNiIjOsOtU P/bcGf9Jsq6TcY9iViO4PWEDLXr3YgQ4AdSo6v2ZmYEcfFvqiTB9Ozsn19rnU1X6 G09VvLvhgjbGwH9kP5bWQMxs5smcZ5JtgGp3G9U5shwYh+MxbQFE8tbVSj0eiXKq B37y3bnxJIB2U3E9nm0aGQr8AzRk6piYXKkfuT++oqHYzYRwDJlHUa36wrSAfLA= =BDhP -----END PGP SIGNATURE----- --peau6e7dAtDt7SV25gNMJhvu1PosW1dNR--