Page MenuHomeFreeBSD

kern: ether_gen_addr: randomize on default hostuuid, too
ClosedPublic

Authored by kevans on Apr 16 2021, 1:16 AM.
Tags
None
Referenced Files
F83434818: D29788.diff
Fri, May 10, 12:54 PM
Unknown Object (File)
Mar 7 2024, 11:34 PM
Unknown Object (File)
Feb 18 2024, 3:58 AM
Unknown Object (File)
Dec 23 2023, 10:55 AM
Unknown Object (File)
Dec 19 2023, 6:32 PM
Unknown Object (File)
Dec 12 2023, 9:14 AM
Unknown Object (File)
Dec 9 2023, 11:51 AM
Unknown Object (File)
Dec 9 2023, 11:51 AM

Details

Summary

Currently, this will still hash the default (all zero) hostuuid and
potentially arrive at a MAC address that has a high chance of collision
if another interface of the same name appears in the same broadcast
domain on another host without a hostuuid, e.g., some virtual machine
setups.

Instead of using the default hostuuid, just treat it as a failure and
generate a random LA unicast MAC address.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38613
Build 35502: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Apr 16 2021, 1:27 AM
donner added inline comments.
sys/net/if_ethersubr.c
1480
return;
gbe added a subscriber: gbe.

LGTM from manpages.

bz added a subscriber: bz.

Don't forget to bump .Dd on the man page when committing.

In D29788#668512, @bz wrote:

Don't forget to bump .Dd on the man page when committing.

You took the words right out of my mouth. :)

sys/net/if_ethersubr.c
1476

Maybe it's worth having this logic as a separate function instead of the goto block?

sys/net/if_ethersubr.c
1476

I'd tend to prefer not... this is really just a failure path, and we shouldn't expose a "random mac address" KPI since we're somewhat trying to reduce the # LA addresses we're randomly generating.

LGTM still will you push it?

Yeah, sorry; $life interfered, but I'll round up some time ~tonight