Page MenuHomeFreeBSD

[PPC64] pseries llan: fix MAC address
ClosedPublic

Authored by luporl on Jul 3 2019, 4:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 10, 6:10 AM
Unknown Object (File)
Thu, May 2, 1:31 AM
Unknown Object (File)
Sun, Apr 28, 8:10 AM
Unknown Object (File)
Mar 5 2024, 11:04 PM
Unknown Object (File)
Dec 20 2023, 4:29 AM
Unknown Object (File)
Nov 15 2023, 11:30 PM
Unknown Object (File)
Nov 7 2023, 5:17 AM
Unknown Object (File)
Nov 6 2023, 11:27 PM
Subscribers

Details

Summary

There was an issue in pseries llan driver, that resulted in the first 2 bytes of the MAC address getting stripped, and the last 2 being always 0.

In most cases the network interface still worked, despite the MAC being different of what was specified to QEMU, but when some other host or DHCP server expected a specific MAC, this would fail.

This change fixes this by shifting right by 2 the local-mac-address read from device tree, if its length is 6 instead of 8, as observed in QEMU DT, that always presents a 6 bytes value for this property.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/powerpc/pseries/phyp_llan.c
173 ↗(On Diff #59348)

You can simply use memmove() or bcopy() here. Doesn't really make a significant difference, though. I think gcc and clang will both degenerate this into the equivalent loop, or a more optimized form.

  • Address jhibbits comments
luporl added inline comments.
sys/powerpc/pseries/phyp_llan.c
173 ↗(On Diff #59348)

Right.

This revision is now accepted and ready to land.Jul 3 2019, 9:26 PM
This revision was automatically updated to reflect the committed changes.