Skip to content
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: dhcpv4: switch to new work API #33389

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

pabigot
Copy link
Collaborator

@pabigot pabigot commented Mar 16, 2021

Use the reschedule variant throughout. Trace lock dependencies and
add mutex around a call site that failed to protect races between the
work handler and the code that sets timer state.

Based on #33372

@@ -1071,7 +1077,9 @@ static enum net_verdict net_dhcpv4_input(struct net_conn *conn,

net_pkt_unref(pkt);

k_mutex_lock(&lock, K_FOREVER);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dhcpv4_handle_reply() already does locking so this should not be needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

IMO it would be helpful if functions more clearly documented their interaction with the lock, which is why I've done so for the ones on the code paths relevant to dhcpv4_timeout. If you'd rather not have those I'll remove them from the PR.

@pabigot pabigot force-pushed the nordic/20210316a branch 2 times, most recently from fad30b2 to 744962d Compare March 16, 2021 15:35
Use the reschedule variant throughout.

Signed-off-by: Peter Bigot <[email protected]>
@pabigot pabigot marked this pull request as ready for review March 18, 2021 13:11
@jukkar jukkar requested a review from rlubos March 18, 2021 15:26
@nashif nashif merged commit 0f93d58 into zephyrproject-rtos:master Mar 18, 2021
@pabigot pabigot deleted the nordic/20210316a branch April 16, 2021 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants