On Tue, 13 Dec 2005 11:45, Stephen Hemminger wrote: > On Mon, 12 Dec 2005 18:56:49 -0600 > > Michael Ellerman <[EMAIL PROTECTED]> wrote: > > Since a5fe736eaf9bae1b45317313de04b564441b94f2 (2.6.13-rc1 ish), > > is_valid_ether_addr() has been broken, because its assumption that > > FF:FF:FF:FF:FF:FF is a multicast address is wrong. Ouch. > > > > Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]> > > --- > > > > include/linux/etherdevice.h | 6 +++--- > > 1 files changed, 3 insertions(+), 3 deletions(-) > > > > Index: linux/include/linux/etherdevice.h > > =================================================================== > > --- linux.orig/include/linux/etherdevice.h > > +++ linux/include/linux/etherdevice.h > > @@ -91,9 +91,9 @@ static inline int is_broadcast_ether_add > > */ > > static inline int is_valid_ether_addr(const u8 *addr) > > { > > - /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to > > - * explicitly check for it here. */ > > - return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); > > + return !is_broadcast_ether_addr(addr) && > > + !is_multicast_ether_addr(addr) && > > + !is_zero_ether_addr(addr); > > } > > why not > return !(addr[0] & 1) && !is_zero_ether_addr(addr);
How about we get the semantics right first, and then worry about optimisations? Or not. cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person
pgpv8qhpQ7Jk4.pgp
Description: PGP signature