From 55747938b5c4c913f742fd03189f0c660ced7bef Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 27 Feb 2023 15:50:56 -0700 Subject: [PATCH] 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 Differential Revision: https://reviews.freebsd.org/D34485 --- sys/dev/re/if_re.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index aaf3860fcc48..734760898e55 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -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. */