luid: change last byte instead of first on luid_get() re-calls#12623
Closed
miri64 wants to merge 1 commit intoRIOT-OS:masterfrom
Closed
luid: change last byte instead of first on luid_get() re-calls#12623miri64 wants to merge 1 commit intoRIOT-OS:masterfrom
luid_get() re-calls#12623miri64 wants to merge 1 commit intoRIOT-OS:masterfrom
Conversation
For the first byte bit 2 and 3 are changed when used as EUI-64 to make it a valid unicast EUI-64. So changing only the first byte on re-calls of `luid_get()` reduces the potential pool of non-duplicates for nodes with multiple interfaces.
Contributor
|
The problem is that (most)? drivers will use the first two bytes for the short address so this will now always be the same if there are multiple interfaces. |
Member
Author
|
True. Then this needs to be fixed as well. I don't think using the second MSB arbitrarily is a good idea either. |
Member
Author
|
Closing in favor of @benpicco's future PR ;-) (see #12592 (comment)) |
Contributor
|
Well I haven not started yet 😉 |
Member
|
The last byte is usually the most valuable in terms of uniqueness. Modifying it will yield a higher collision probability than modifying any other byte. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
For the first byte bit 2 and 3 are changed when e.g. used as EUI-64 to make it a valid unicast EUI-64. So changing only the first byte on re-calls of
luid_get()reduces the potential pool of non-duplicates for nodes with multiple interfaces.The general doc btw already states as much:
RIOT/sys/include/luid.h
Lines 36 to 37 in 85a392e
Testing procedure
A node with two network devices using the same address length and using
luid_get()to generate the MAC address should differ in their last byte now, not the first.Issues/PRs references
Alternative to #12592