1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

MDNS: fix random crash on startup (#6261)

* mDNS debug option + AP address is used by default when STA is also present

* mDNS: store network interface, checking it is up

* igmp: force on selected interface (avoid crash *sometimes*)

* fix for all lwip2 ipv4 ipv6 & lwip1

* mdns: IPAddress is not needed to reference associated interface

* mdns: debug: fix print warnings

* emulation: add ets_strncpy

* emulation: truly emulate AddrList (remove fake one)
This commit is contained in:
david gauchard
2019-09-05 05:10:47 +02:00
committed by Earle F. Philhower, III
parent 273f4000f0
commit 5ca0bde200
12 changed files with 288 additions and 315 deletions

View File

@ -44,6 +44,7 @@ extern "C"
{
#include <user_interface.h>
#include <lwip/netif.h>
uint8 wifi_get_opmode(void)
{
@ -115,6 +116,8 @@ void wifi_fpm_set_sleep_type (sleep_type_t type)
uint32_t global_ipv4_netfmt = 0; // global binding
netif netif0;
bool wifi_get_ip_info (uint8 if_index, struct ip_info *info)
{
struct ifaddrs * ifAddrStruct = NULL, * ifa = NULL;
@ -165,6 +168,12 @@ bool wifi_get_ip_info (uint8 if_index, struct ip_info *info)
info->ip.addr = ipv4;
info->netmask.addr = mask;
info->gw.addr = ipv4;
netif0.ip_addr.addr = ipv4;
netif0.netmask.addr = mask;
netif0.gw.addr = ipv4;
netif0.flags = NETIF_FLAG_IGMP | NETIF_FLAG_UP | NETIF_FLAG_LINK_UP;
netif0.next = nullptr;
}
return true;