if_re: Generate an address if there is none in the EEPROM

There exists hardware that has no ethernet address burned into
the EEPROM. Loading if_re on such a HW brings the device up
with '00:00:00:00:00:00' as the address, and that doesn't get
you too far in a real network.

PR: 262406
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/670
Signed-off-by: Evgeni Golov <evgeni@debian.org>
Differential Revision: https://reviews.freebsd.org/D34485
This commit is contained in:
Evgeni Golov 2023-02-27 15:50:56 -07:00 committed by Warner Losh
parent 28ed159f26
commit 55747938b5

View File

@ -1674,6 +1674,11 @@ re_attach(device_t dev)
goto fail;
}
/* If address was not found, create one based on the hostid and name. */
if (ETHER_IS_ZERO(eaddr)) {
ether_gen_addr(ifp, (struct ether_addr *)eaddr);
}
/*
* Call MI attach routine.
*/