diff options
| author | Kevin Bowling <kbowling@FreeBSD.org> | 2021-08-20 14:45:30 +0000 |
|---|---|---|
| committer | Kevin Bowling <kbowling@FreeBSD.org> | 2021-08-27 01:33:48 +0000 |
| commit | 8b043521b41664f4f2bd18087511508b7af776c0 (patch) | |
| tree | 42df5409c787b3176e32bd72698cbd620480c986 /sys/dev/ixl | |
| parent | 96f65d85d43167e3e65738c2b93414dea071015a (diff) | |
Diffstat (limited to 'sys/dev/ixl')
| -rw-r--r-- | sys/dev/ixl/if_iavf.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/dev/ixl/if_iavf.c b/sys/dev/ixl/if_iavf.c index f6eb91c2a855..123db2e2461d 100644 --- a/sys/dev/ixl/if_iavf.c +++ b/sys/dev/ixl/if_iavf.c @@ -433,13 +433,9 @@ iavf_if_attach_pre(if_ctx_t ctx) iavf_dbg_init(sc, "Resource Acquisition complete\n"); /* If no mac address was assigned just make a random one */ - if (!iavf_check_ether_addr(hw->mac.addr)) { - u8 addr[ETHER_ADDR_LEN]; - arc4rand(&addr, sizeof(addr), 0); - addr[0] &= 0xFE; - addr[0] |= 0x02; - bcopy(addr, hw->mac.addr, sizeof(addr)); - } + if (!iavf_check_ether_addr(hw->mac.addr)) + ether_gen_addr(iflib_get_ifp(ctx), + (struct ether_addr *)hw->mac.addr); bcopy(hw->mac.addr, hw->mac.perm_addr, ETHER_ADDR_LEN); iflib_set_mac(ctx, hw->mac.addr); |
