mirror of
https://github.com/espressif/esp-idf
synced 2025-04-08 15:50:10 -04:00
mdns: Fix of crash when wifi interface get deleted and mdns receives the packets
Closes https://github.com/espressif/esp-idf/issues/6973
This commit is contained in:
parent
b20c5e3756
commit
0a387f98de
@ -73,6 +73,17 @@ esp_netif_t *_mdns_get_esp_netif(mdns_if_t tcpip_if)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @brief Clean internal mdns interface's pointer
|
||||||
|
*/
|
||||||
|
static inline void _mdns_clean_netif_ptr(mdns_if_t tcpip_if) {
|
||||||
|
if (tcpip_if < MDNS_IF_MAX) {
|
||||||
|
s_esp_netifs[tcpip_if] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief Convert esp-netif handle to mdns if
|
* @brief Convert esp-netif handle to mdns if
|
||||||
*/
|
*/
|
||||||
@ -3110,6 +3121,8 @@ void _mdns_enable_pcb(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol)
|
|||||||
*/
|
*/
|
||||||
void _mdns_disable_pcb(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol)
|
void _mdns_disable_pcb(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol)
|
||||||
{
|
{
|
||||||
|
_mdns_clean_netif_ptr(tcpip_if);
|
||||||
|
|
||||||
if (_mdns_server->interfaces[tcpip_if].pcbs[ip_protocol].pcb) {
|
if (_mdns_server->interfaces[tcpip_if].pcbs[ip_protocol].pcb) {
|
||||||
_mdns_clear_pcb_tx_queue_head(tcpip_if, ip_protocol);
|
_mdns_clear_pcb_tx_queue_head(tcpip_if, ip_protocol);
|
||||||
_mdns_pcb_deinit(tcpip_if, ip_protocol);
|
_mdns_pcb_deinit(tcpip_if, ip_protocol);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user