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)
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
Unknown Object (File)
Oct 30 2023, 9:06 AM
Unknown Object (File)
Oct 14 2023, 10:32 PM
Unknown Object (File)
Oct 6 2023, 4:17 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25194
Build 23876: arc lint + arc unit

Event Timeline

sys/powerpc/pseries/phyp_llan.c
173

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

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.