diff --git a/libraries/ESP8266LLMNR/ESP8266LLMNR.cpp b/libraries/ESP8266LLMNR/ESP8266LLMNR.cpp index 1b855f009..f4ab21aad 100644 --- a/libraries/ESP8266LLMNR/ESP8266LLMNR.cpp +++ b/libraries/ESP8266LLMNR/ESP8266LLMNR.cpp @@ -50,7 +50,7 @@ extern "C" { //#define LLMNR_DEBUG -#define BIT(x) (1 << (x)) +//BIT(x) is defined in tools/sdk/c_types.h #define FLAGS_QR BIT(15) #define FLAGS_OP_SHIFT 11 @@ -226,14 +226,15 @@ void LLMNRResponder::_process_packet() { Serial.println("(no matching RRs)"); #endif - struct ip_info remote_ip_info; - remote_ip_info.ip.addr = _conn->getRemoteAddress(); + ip_addr_t remote_ip; + remote_ip.addr = _conn->getRemoteAddress(); + struct ip_info ip_info; bool match_ap = false; if (wifi_get_opmode() & SOFTAP_MODE) { wifi_get_ip_info(SOFTAP_IF, &ip_info); - if (ip_info.ip.addr && ip_addr_netcmp(&remote_ip_info.ip, &ip_info.ip, &ip_info.netmask)) - match_ap = true; + if (ip_info.ip.addr && ip_addr_netcmp(&remote_ip, &ip_info.ip, &ip_info.netmask)) + match_ap = true; } if (!match_ap) wifi_get_ip_info(STATION_IF, &ip_info); @@ -272,8 +273,8 @@ void LLMNRResponder::_process_packet() { }; _conn->append(reinterpret_cast(rr), sizeof(rr)); } - _conn->setMulticastInterface(remote_ip_info.ip); - _conn->send(&remote_ip_info.ip, _conn->getRemotePort()); + _conn->setMulticastInterface(remote_ip); + _conn->send(&remote_ip, _conn->getRemotePort()); } #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_LLMNR)