sys/luid: add luid_netdev_get_eui48() & luid_netdev_get_eui64() #14778
sys/luid: add luid_netdev_get_eui48() & luid_netdev_get_eui64() #14778maribu merged 3 commits intoRIOT-OS:masterfrom
Conversation
3ec0862 to
eb34875
Compare
|
OK, while I agree on having this (so that the same LUID is generated reagrdless of the number of calls to luid_get() prior to the initialization of netdevs), we should avoid calling to it in the reset procedure. We should make double sure that during reset the previously configured L2 address is applied to the device again. Note that the network stack has an in memory copy of the L2 address anyway, as frames need to be prepared with a source address. Just using this in memory copy to restore the L2 address after a device sleep ist what we should do, even though this PR fixes the issue in cases the L2 address is not applied manually. |
Add functions to generate an EUI based on the netdev ID. This will always return the same EUI for the same netdev, so it is stable across netdev resets.
eb34875 to
e5f42a1
Compare
maribu
left a comment
There was a problem hiding this comment.
See inline comment. I'm still less than happy that we have to cast the address to eui64_t. We should either use that type for the address in the netdev_ieee802154_t, or let the luid_get API accept uint8_t arrays.
e5f42a1 to
821c6f7
Compare
821c6f7 to
9823801
Compare
|
I trust the record of your testing in the PR description |
|
Last CI run was 6 hours ago, that should be recent enough. |
Contribution description
Add functions to generate an EUI based on the netdev ID.
This will always return the same EUI for the same netdev, so it is stable across netdev resets.
Testing procedure
As a demonstration, the
at86rf215driver has been converted to the new function.This will be replaced by calls to
netdev_eui64_get()once #14634 is merged.It shows that the two interfaces still get distinct MAC addresses
They are also stable across resets
Issues/PRs references
Will be used by #14634, but can also be used independently.
alternative to #14363