-
-
Notifications
You must be signed in to change notification settings - Fork 86
Mdns double add #309
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
base: master
Are you sure you want to change the base?
Mdns double add #309
Conversation
LWIP assertion clearly shows that calling mdns_resp_add_netif twice for the same interface is a no-no. So to prevent this we need to be able to easily check if this was already called. This PR adds a simple map that keeps track of the initialization state per each interface (identified via netif->num).
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.
Thanks for the fix.
I'm currently testing it on my bk72xx.wb3s board with the esphome platform. Maybe this fixes the frequent network losses I observe.
I will report back wether it is more stable now.
| { | ||
| stateIter = sNetIfState.insert(std::make_pair(netif->num, StateForNetIf::DISABLED)).first; | ||
| } | ||
| auto currentState = sNetIfState[netif->num]; |
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.
This variable is unused.
Unfortunately my device still reboots due to an LWIP assert with the fix here. At the moment I can't connect a serial port to see the exact issue. |
LWIP assertion clearly shows that calling mdns_resp_add_netif twice for the same interface is a no-no. So to prevent this we need to be able to easily check if this was already called.
This PR adds a simple map that keeps track of the initialization state per each interface (identified via netif->num). This should fix #306