Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 07 Mar 2022 19:33:15 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 262406] [re] if_re doesn't generate MAC address if hardware has none
Message-ID:  <bug-262406-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262406

            Bug ID: 262406
           Summary: [re] if_re doesn't generate MAC address if hardware
                    has none
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: evgeni@debian.org

Ohai,

there exists hardware (like [1]) that has no ethernet address burned into t=
he
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 r=
eal
network.

Other drivers use ether_gen_addr(9) in such cases, to generate an address, =
and
so should if_re, I think?

Probably something like this (untested yet):

diff --git sys/dev/re/if_re.c sys/dev/re/if_re.c
index 5d1446e51ab..7905740a930 100644
--- sys/dev/re/if_re.c
+++ sys/dev/re/if_re.c
@@ -1676,6 +1676,11 @@ re_attach(device_t dev)
                goto fail;
        }

+       /* If address was not found, create one based on the hostid and nam=
e.
*/
+       if (ETHER_IS_ZERO(eaddr)) {
+               ether_gen_addr(ifp, eaddr);
+       }
+
        /*
         * Call MI attach routine.
         */

Thanks!

[1] https://www.dfrobot.com/product-2242.html

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-262406-227>