Skip to content

Conversation

@szupi-ipuzs
Copy link
Contributor

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

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).
Copy link

@mkbit mkbit left a 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];
Copy link

Choose a reason for hiding this comment

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

This variable is unused.

@mkbit
Copy link

mkbit commented Aug 21, 2025

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.

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.

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

Successfully merging this pull request may close these issues.

lwip assertion: esp_add_netif: Double add

2 participants