diff options
author | adrian <adrian@FreeBSD.org> | 2015-03-15 21:56:41 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2015-03-15 21:56:41 +0000 |
commit | af70fecfb97a489f6de7d302f64af0ed62554bcb (patch) | |
tree | d56f8954dc38a5f5e7a1697ea21d1831e82d8d45 /sys/mips/atheros | |
parent | 74b6ad6fe41c97f2f2d911d57743404e8a9db094 (diff) | |
download | FreeBSD-src-af70fecfb97a489f6de7d302f64af0ed62554bcb.zip FreeBSD-src-af70fecfb97a489f6de7d302f64af0ed62554bcb.tar.gz |
Use ar71xx_mac_addr_random_init() instead of a hand-rolled random
MAC address.
Diffstat (limited to 'sys/mips/atheros')
-rw-r--r-- | sys/mips/atheros/if_arge.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/mips/atheros/if_arge.c b/sys/mips/atheros/if_arge.c index ffbe2d3..fee33b1 100644 --- a/sys/mips/atheros/if_arge.c +++ b/sys/mips/atheros/if_arge.c @@ -96,6 +96,7 @@ MODULE_VERSION(arge, 1); #include <mips/atheros/if_argevar.h> #include <mips/atheros/ar71xx_setup.h> #include <mips/atheros/ar71xx_cpudef.h> +#include <mips/atheros/ar71xx_macaddr.h> typedef enum { ARGE_DBG_MII = 0x00000001, @@ -567,7 +568,6 @@ arge_attach(device_t dev) struct ifnet *ifp; struct arge_softc *sc; int error = 0, rid; - uint32_t rnd; int is_base_mac_empty, i; uint32_t hint; long eeprom_mac_addr = 0; @@ -746,14 +746,7 @@ arge_attach(device_t dev) if (bootverbose) device_printf(dev, "Generating random ethernet address.\n"); - - rnd = arc4random(); - sc->arge_eaddr[0] = 'b'; - sc->arge_eaddr[1] = 's'; - sc->arge_eaddr[2] = 'd'; - sc->arge_eaddr[3] = (rnd >> 24) & 0xff; - sc->arge_eaddr[4] = (rnd >> 16) & 0xff; - sc->arge_eaddr[5] = (rnd >> 8) & 0xff; + (void) ar71xx_mac_addr_random_init(sc->arge_eaddr); } /* |