Page MenuHomeFreeBSD

intel ethernet: Use ether_gen_addr
ClosedPublic

Authored by kbowling on Aug 20 2021, 2:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 22 2024, 9:25 PM
Unknown Object (File)
Dec 20 2023, 12:37 PM
Unknown Object (File)
Dec 20 2023, 1:10 AM
Unknown Object (File)
Dec 11 2023, 6:23 AM
Unknown Object (File)
Nov 18 2023, 10:02 PM
Unknown Object (File)
Nov 17 2023, 11:14 PM
Unknown Object (File)
Nov 15 2023, 5:46 PM
Unknown Object (File)
Nov 7 2023, 1:26 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

@jrtc27 is there any issue to CHERI with the ether_addr cast like this? It is __packed.

@jrtc27 is there any issue to CHERI with the ether_addr cast like this? It is __packed.

No, that should be fine, the only time packed causes issues is when it's on structs that contain pointers (including intptr_t). I don't know why ether_addr is packed though, it just contains a byte array, packed is redundant.

imp added inline comments.
sys/dev/e1000/if_em.c
1080

I think this type punning is OK and well defined. The ether_addr structure is just an array of 6 bytes for the array, and hw->mac.addr provides 6 bytes of storage. __packed on the ether_addr structure should keep this well defined.

I don't know why ether_addr is packed though, it just contains a byte array, packed is redundant.

I think it may date from the pre-EABI days of ARM where it did really weird things with structure padding. I suspect it can be dropped, but conservatism and the fact there will be little gain from dropping it has kept people from doing so...

This revision is now accepted and ready to land.Aug 20 2021, 7:11 PM