-
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
gnrc_netif: fix timeout in gnrc_netif_ipv6_wait_for_global_address()
#21137
gnrc_netif: fix timeout in gnrc_netif_ipv6_wait_for_global_address()
#21137
Conversation
c5ccefa
to
a95bd50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks very good to me.
very good use of ztimer -- reducing the number of ztimer_now.
I assume you tested this.
In case I would trust your testing and approve.
if (ztimer_msg_receive_timeout(ZTIMER_MSEC, &m, timeout_ms) < 0) { | ||
if (timeout_ms == UINT32_MAX) { | ||
msg_receive(&m); | ||
} else if (ztimer_msg_receive_timeout(ZTIMER_MSEC, &m, timeout_ms) < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else if (ztimer_msg_receive_timeout(ZTIMER_MSEC, &m, timeout_ms) < 0) { | |
} | |
else if (ztimer_msg_receive_timeout(ZTIMER_MSEC, &m, timeout_ms) < 0) { |
according to RIOT coding style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since both styles are already in this file, this can be ignored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contribution description
The timeout value in
gnrc_netif_ipv6_wait_for_global_address()
would overflow for large timeouts, leading to an immediate return.Instead of doing arithmetic, set a proper timer - or don't if the timeout is
UINT32_MAX
.Testing procedure
Issues/PRs references