Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

More for fixing MDNS

Open d-a-v opened this issue 3 years ago • 3 comments

After @hreintke 's fix (#8641 from #8308), this notice and these lwIP guidelines brought to attention by @mcspr,

our mDNS implementation will benefit from part or all these suggestions:

d-a-v avatar Sep 13 '22 13:09 d-a-v

LwipIntf::stateUpCB()

s/LwipIntf::stateUpCB()/LwipIntf::ipChangeCB()/ ? in case of DHCP, that would be called twice

Might be confusing for static ip? Need to check examples, though. Is it 'STATE UP -> set ip addresses' or 'set ip addresses -> STATE UP'? In the referenced issue that was 'solved' by optional EXT callbacks feature within LWIP core, I don't see any callbacks in dhcp client. Same for auto-ip :/

mcspr avatar Sep 13 '22 13:09 mcspr

We can also considerate bringing interface DOWN then UP when IP changes

d-a-v avatar Sep 13 '22 13:09 d-a-v

Also seems weird :/ Can we replace netif_status_changed with netif->status_callback? https://github.com/lwip-tcpip/lwip/blob/239918ccc173cb2c2a62f41a40fd893f57faf1d6/src/core/netif.c#L350-L352 https://github.com/lwip-tcpip/lwip/blob/239918ccc173cb2c2a62f41a40fd893f57faf1d6/src/core/netif.c#L504 (called on IP change) https://github.com/lwip-tcpip/lwip/blob/239918ccc173cb2c2a62f41a40fd893f57faf1d6/src/core/netif.c#L882 (called on UP / DOWN)

mcspr avatar Sep 13 '22 13:09 mcspr