Page MenuHomeFreeBSD

[PPC64] pseries llan: fix MAC address
ClosedPublic

Authored by luporl on Jul 3 2019, 4:34 PM.
Tags
None
Referenced Files
F106033893: D20843.diff
Tue, Dec 24, 5:34 AM
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
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 25191
Build 23873: 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.