FreeBSD Bugzilla – Attachment 245239 Details for
Bug 274092
if_smsc.c needs to use ether_gen_addr instead of read_random for more stable MAC address
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
git diff to use ether_gen_addr
if_smsc.c.diff (text/plain), 1001 bytes, created by
Ronald Klop
on 2023-09-25 22:11:57 UTC
(
hide
)
Description:
git diff to use ether_gen_addr
Filename:
MIME Type:
Creator:
Ronald Klop
Created:
2023-09-25 22:11:57 UTC
Size:
1001 bytes
patch
obsolete
>diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c >index 0a0268bfa1a2..96dfb2fa82f6 100644 >--- a/sys/dev/usb/net/if_smsc.c >+++ b/sys/dev/usb/net/if_smsc.c >@@ -1554,8 +1554,10 @@ static void > smsc_attach_post(struct usb_ether *ue) > { > struct smsc_softc *sc = uether_getsc(ue); >+ struct ether_addr eaddr; > uint32_t mac_h, mac_l; > int err; >+ int i; > > smsc_dbg_printf(sc, "smsc_attach_post\n"); > >@@ -1589,9 +1591,10 @@ smsc_attach_post(struct usb_ether *ue) > err = usb_fdt_get_mac_addr(sc->sc_ue.ue_dev, &sc->sc_ue); > #endif > if ((err != 0) || (!ETHER_IS_VALID(sc->sc_ue.ue_eaddr))) { >- read_random(sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN); >- sc->sc_ue.ue_eaddr[0] &= ~0x01; /* unicast */ >- sc->sc_ue.ue_eaddr[0] |= 0x02; /* locally administered */ >+ device_printf(ue->ue_dev, "No MAC address found. Using ether_gen_addr().\n"); >+ ether_gen_addr(ue->ue_ifp, &eaddr); >+ for (i = 0; i < ETHER_ADDR_LEN; i++) >+ sc->sc_ue.ue_eaddr[i] = eaddr.octet[i]; > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 274092
:
245237
|
245239
|
245577
|
245603
|
245616
|
246108
|
246128
|
246231