Date: Tue, 22 Oct 2013 18:14:07 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256919 - head/sys/dev/ffec Message-ID: <201310221814.r9MIE7F1066916@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Tue Oct 22 18:14:06 2013 New Revision: 256919 URL: http://svnweb.freebsd.org/changeset/base/256919 Log: Mask out non-address bits in the mac address register, for proper detection of an all-zeroes address. Also remove a misplaced return. Reviewed by: br@ Modified: head/sys/dev/ffec/if_ffec.c Modified: head/sys/dev/ffec/if_ffec.c ============================================================================== --- head/sys/dev/ffec/if_ffec.c Tue Oct 22 18:07:49 2013 (r256918) +++ head/sys/dev/ffec/if_ffec.c Tue Oct 22 18:14:06 2013 (r256919) @@ -883,7 +883,7 @@ ffec_get_hwaddr(struct ffec_softc *sc, u * assigned bit set, and the broadcast/multicast bit clear. */ palr = RD4(sc, FEC_PALR_REG); - paur = RD4(sc, FEC_PAUR_REG); + paur = RD4(sc, FEC_PAUR_REG) & FEC_PAUR_PADDR2_MASK; if ((palr | paur) != 0) { hwaddr[0] = palr >> 24; hwaddr[1] = palr >> 16; @@ -891,7 +891,6 @@ ffec_get_hwaddr(struct ffec_softc *sc, u hwaddr[3] = palr >> 0; hwaddr[4] = paur >> 24; hwaddr[5] = paur >> 16; - return; } else { rnd = arc4random() & 0x00ffffff; hwaddr[0] = 'b';
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310221814.r9MIE7F1066916>