Skip to content

sys/net/gnrc/netif: fixing no global address wait #19402

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

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

jan-mo
Copy link
Contributor

@jan-mo jan-mo commented Mar 17, 2023

Contribution description

The function gnrc_netif_ipv6_wait_global_address() will always return true, even if no global address is attached to the interface.
Currently the function only waits for any message and does not check if it was from the bus or not. So in msg.content.ptr is no valid address and therefore it returns true.

I added just the check, if the message is from the bus of any interface and then checking the address. We could also first check if the address in msg.content.ptr is valid, but this will just hide the bug. Also the timeout was never checked. It was just assuming that no other message will be received during the wait.

Testing procedure

Use two devices, one works as a border router and supports the global address, the other will wait for the global address. You can call the function gnrc_netif_ipv6_wait_global_address() on the waiting node and see whether it returns true and finds the global address in the given time-range.

@github-actions github-actions bot added Area: network Area: Networking Area: sys Area: System labels Mar 17, 2023
@jan-mo jan-mo force-pushed the fix/20230317__wait_for_global_addr branch from 41fa15a to b51e6e6 Compare March 17, 2023 09:26
@jan-mo jan-mo force-pushed the fix/20230317__wait_for_global_addr branch 2 times, most recently from 611ce8c to be6d994 Compare March 17, 2023 12:27
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 17, 2023
@riot-ci
Copy link

riot-ci commented Mar 17, 2023

Murdock results

✔️ PASSED

72107a0 sys/net/gnrc/netif: fixing no global address wait

Success Failures Total Runtime
6882 0 6882 09m:19s

Artifacts

@jan-mo jan-mo force-pushed the fix/20230317__wait_for_global_addr branch from be6d994 to 72107a0 Compare March 17, 2023 12:45
@benpicco
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented Mar 17, 2023

Build succeeded:

@bors bors bot merged commit 2fcedf9 into RIOT-OS:master Mar 17, 2023
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.04 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants