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