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
net: ipv6: Improve DAD/MLD behavior on interface down/up #72587
Merged
nashif
merged 4 commits into
zephyrproject-rtos:main
from
rlubos:net/ipv6-missing-dad-and-mcast-addresses
May 14, 2024
Merged
net: ipv6: Improve DAD/MLD behavior on interface down/up #72587
nashif
merged 4 commits into
zephyrproject-rtos:main
from
rlubos:net/ipv6-missing-dad-and-mcast-addresses
May 14, 2024
Conversation
This file contains 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
In case a network interface is brought down and back up, DAD was not performed for link-local unicast address. This happens because the logic in the network interface code assumed that DAD for link-local address is triggered when the address is added, and it's explicitly omited when looping over IPv6 address. This wasn't the case however when interface was brought back up, as the address was already present on the interface, hence DAD skipped. In Linux, the link-local address is removed from the interface when the interface is brought down. Such approach solves the issue described, hence implement it in a similar way in Zephyr. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When bringing interface down, all IPv6 multicast addresses are removed from the interface. However, when the interface was brought back up, rejoin_ipv6_mcast_groups() would look only for solicited node mcast addresses already present on the interface. In result, after going back up, the interface was missing solicited-node mcast addresses for those unicast addresses, that were already present on the interface when bringing up. As net_ipv6_mld_join() does similar checks to skip MLD when not needed, we can just skip the lookup when rejoining, and use already defined join_mcast_nodes(). Additionally, check for IPV6 and NO_ND flags on the interface before attempting to add the address back, those multicast addresses are not needed if ND is disabled on the interface. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
pdgendt
previously approved these changes
May 13, 2024
jukkar
previously approved these changes
May 13, 2024
When the network inteface goes operational DOWN (for example cable unplugged), clear "joined" flag on all registered multicast addresses, so that MLD report is sent for them when the interface goes back up. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
rlubos
force-pushed
the
net/ipv6-missing-dad-and-mcast-addresses
branch
from
May 13, 2024 07:31
120d8d1
to
90c6940
Compare
pdgendt
previously approved these changes
May 13, 2024
jukkar
previously approved these changes
May 13, 2024
Sorry for another push, DHCP tests needed fixing too. |
pdgendt
reviewed
May 13, 2024
pdgendt
previously approved these changes
May 13, 2024
The test suite assigns LL address to the interface manually, hence need to reapply it whenever interface goes up. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
rlubos
force-pushed
the
net/ipv6-missing-dad-and-mcast-addresses
branch
from
May 13, 2024 08:46
714dfd5
to
fc0be1d
Compare
pdgendt
approved these changes
May 13, 2024
jukkar
approved these changes
May 13, 2024
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.
We generally need to improve IPv6 test coverage, involving test cases when interface goes down/up, but opening a PR early with a few fixes for issues spotted when testing manually.