When defining FALLBACK_DNS_SERVER_ADDRESS in a project where only LWIP_IPV4 is enabled, compiling dns_init will result in a compilation error:
esp-idf/components/lwip/lwip/src/core/dns.c: In function 'dns_init':
esp-idf/components/lwip/lwip/src/core/dns.c:328:12: error: 'ip_addr_t' {aka 'struct ip4_addr'} has no member named 'type'
dnsserver.type = IPADDR_TYPE_V4;
This is due to the fact that ip_addr_t is defined as
When defining
FALLBACK_DNS_SERVER_ADDRESS
in a project where onlyLWIP_IPV4
is enabled, compilingdns_init
will result in a compilation error:This is due to the fact that
ip_addr_t
is defined asonly if IPv4 and IPv6 support are enabled at the same time.
In the case where only IPv4 support is enabled, the definition of
ip_addr_t
iswhich lacks the
type
field.This PR aims to fix this and make it compile for our scenario.