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)
Thu, Dec 12, 7:38 PM
Unknown Object (File)
Thu, Nov 28, 6:48 AM
Unknown Object (File)
Nov 20 2024, 8:01 PM
Unknown Object (File)
Nov 16 2024, 9:01 AM
Unknown Object (File)
Nov 16 2024, 7:57 AM
Unknown Object (File)
Nov 12 2024, 7:31 AM
Unknown Object (File)
Nov 12 2024, 4:06 AM
Unknown Object (File)
Nov 9 2024, 11:13 AM
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.