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

Potential thread safety issue #51

Open
damiencampanella opened this issue Aug 7, 2024 · 1 comment
Open

Potential thread safety issue #51

damiencampanella opened this issue Aug 7, 2024 · 1 comment

Comments

@damiencampanella
Copy link

Your code fails if the CONFIG_LWIP_CHECK_THREAD_SAFETY option is activated, because you do not use the thread-safe APIs.

I tried modifying the code by using the netifapi_netif_* functions to solve this thread safety issue but I don't understand why the peer keeps being down.
My understanding is that these functions are just wrappers to run the original netif_* function inside the tcpip_thread context, so it should behave like the original functions.

@trombik: I will continue debugging this but I wanted to have your opinion about this potential thread safety issue, and if you understand why it could fail when using the thread-safe API.

@trombik
Copy link
Owner

trombik commented Aug 8, 2024

Thanks for reporting the issue. When I ported, thread safety was not in my mind. As I am not an expert in lwip stack, I am certainly not in a position to comment on thread-safe APIs. Moving to newer esp-idf APIs has been in my TODOs list, but I have been in a difficult situation in my personal life.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants