1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-06 05:21:22 +03:00

MDNS: fix legacy unicast responses (#6613)

* mdns: use ID from parameter struct when constructing response message

* print id for legacy requests
This commit is contained in:
Max Prokhorov 2019-10-07 15:25:51 +03:00 committed by david gauchard
parent d7abafea2f
commit d62fb9ffeb
2 changed files with 2 additions and 2 deletions

View File

@ -245,7 +245,7 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
((wifi_get_ip_info(STATION_IF, &IPInfo_Local)) &&
(ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask))))) { // Remote IP in STATION's subnet
DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from local host %s!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from local host %s, id %u!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), p_MsgHeader.m_u16ID););
sendParameter.m_u16ID = p_MsgHeader.m_u16ID;
sendParameter.m_bLegacyQuery = true;

View File

@ -141,7 +141,7 @@ bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_r
bool bResult = true;
// Prepare header; count answers
stcMDNS_MsgHeader msgHeader(0, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
stcMDNS_MsgHeader msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
// If this is a response, the answers are anwers,
// else this is a query or probe and the answers go into auth section
uint16_t& ru16Answers = (p_rSendParameter.m_bResponse