1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-14 13:41:23 +03:00

Fixes for IPv6, added in CI (#5557)

This commit is contained in:
david gauchard
2018-12-27 16:13:48 +01:00
committed by GitHub
parent 9def8b0669
commit e3bc3c226b
12 changed files with 85 additions and 76 deletions

View File

@ -191,19 +191,18 @@ bool MDNSResponder::_allocUDPContext(void) {
_releaseUDPContext();
ip_addr_t multicast_addr;
#ifdef MDNS_IP4_SUPPORT
multicast_addr.addr = DNS_MQUERY_IPV4_GROUP_INIT;
ip_addr_t multicast_addr = DNS_MQUERY_IPV4_GROUP_INIT;
#endif
#ifdef MDNS_IP6_SUPPORT
//TODO: set multicast address
//TODO: set multicast address (lwip_joingroup() is IPv4 only at the time of writing)
multicast_addr.addr = DNS_MQUERY_IPV6_GROUP_INIT;
#endif
if (ERR_OK == igmp_joingroup(IP_ADDR_ANY, &multicast_addr)) {
if (ERR_OK == igmp_joingroup(IP4_ADDR_ANY4, ip_2_ip4(&multicast_addr))) {
m_pUDPContext = new UdpContext;
m_pUDPContext->ref();
if (m_pUDPContext->listen(IP_ADDR_ANY, DNS_MQUERY_PORT)) {
if (m_pUDPContext->listen(IP4_ADDR_ANY, DNS_MQUERY_PORT)) {
m_pUDPContext->setMulticastTTL(MDNS_MULTICAST_TTL);
m_pUDPContext->onRx(std::bind(&MDNSResponder::_callProcess, this));