-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nib.c: add interface selection rules for static link local address assignment #20784
nib.c: add interface selection rules for static link local address assignment #20784
Conversation
Maybe it's just me, but this inverse logic always leads to mental contortions. If it's not set, the static address would still apply on all interfaces. |
+1 for Was it really intended back then, to have a static address for all interfaces? But to solve the issue, a quick |
The problem with this approach is that netdev IDs are not stable and will shift around as modules (threads) get added, so using netdev IDs is always very brittle. What works better is netdev type + index, but that's a bit more complicated code/configuration wise, so using the same link-local address for all interfaces was simply the easiest solution. |
74c7498
to
9ce1aa1
Compare
@benpicco I just updated this PR with a positive selection. |
I would not miss it. It is a potential foot gun, if for example in an application you disable one kind of interfaces but don't change this configuration and after that another interface unexpectedly has that address or the PID no longer exists. |
Looks good from my perspective. |
Please squash! |
6efe112
to
7240d37
Compare
done |
UPDATED ON: 2024-08-14, 2024-08-15
Contribution description
Setting static link local addresses is supported in nib.c.
This contribution adds options for applying static link local addresses only on specific interfaces.
Setting the static link local address can be selected by either netdev driver type or by interface number.
Testing procedure
Compile
examples/gnrc_networking
for boardnative
, uncommenting the Makefile linesA static link local address will show up in
ifconfig
:You can now play with the include options. Either
CFLAGS += -DCONFIG_GNRC_IPV6_STATIC_LLADDR_NETDEV_MASK="(1ULL << NETDEV_TAP)"
or
CFLAGS += -DCONFIG_GNRC_IPV6_STATIC_LLADDR_NETDEV_MASK="(1ULL << NETDEV_ANY)"
should leave the netif configuration unaltered, with the static link local address still showing up.
Other values for any of the config variable should make the link local address disappear.
Issues/PRs references
None.