Unconditionally use ether_gen_addr() to generate bridge mac addresses.
This function is now less likely to generate duplicate mac addresses
across jails. The old hand rolled hostid based code adds no value.
Details
- Reviewers
bz kevans - Group Reviewers
network - Commits
- rS360069: bridge: Simplify mac address generation
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 30521 Build 28268: arc lint + arc unit
Event Timeline
sys/net/if_bridge.c | ||
---|---|---|
746 | I don't fully understand the logic but ether_gen_addr() will always give you the same result in the loop so the outcome of the retry is not going to change, right? Do we need the do { } while() loop still or is that an endless loop now and we should rather have proper error handling? I am not even sure this was sane before... But that's probably a different question to raise. |
sys/net/if_bridge.c | ||
---|---|---|
746 | Agreed... I suspect the loop and check for a conflict should probably just go away or get fixed (and not loop unless randomness comes back). It's really not (and wasn't) enough to just check bridge interfaces because those aren't the only kind of interfaces that get generated/random/arbitrary MAC addresses. It also seems like it would've been safer to assume that other vnets on the same machine /could/ be in the same broadcast domain and check bridges in all vnets. |
sys/net/if_bridge.c | ||
---|---|---|
746 | Or for that one of the bridges in one of the 20 machines next to it in the rack running all the same with some similarly broken non-unique setup. |
sys/net/if_bridge.c | ||
---|---|---|
746 | Yeah, that's a great point. We must get rid of the loop here. |