Bugfix/modbus fix using of hostname

This commit is contained in:
Alex Lisitsyn
2024-08-16 22:22:59 +08:00
parent 1eafc29df3
commit cab2708dcf
2 changed files with 2 additions and 2 deletions

View File

@ -498,7 +498,7 @@ static BOOL xMBTCPPortMasterCheckHost(const CHAR *pcHostStr, ip_addr_t *pxHostAd
if (pxHostAddr) {
*pxHostAddr = xTargetAddr;
}
ESP_LOGI(TAG, "Host[IP]: \"%s\"[%s]", pxAddrList->ai_canonname, pcStr);
ESP_LOGI(TAG, "Host IP: [%s]", pcStr);
freeaddrinfo(pxAddrList);
return TRUE;
}

View File

@ -440,7 +440,7 @@ vMBTCPPortBindAddr(const CHAR* pcBindIp)
}
}
// Bind was successful
pcStr = (pxCurAddr->ai_canonname == NULL) ? (CHAR*)"\0" : pxCurAddr->ai_canonname;
pcStr = (pxCurAddr->ai_canonname == NULL) ? (CHAR*)"ANY_IP" : pxCurAddr->ai_canonname;
ESP_LOGI(TAG, "Socket (#%d), listener %s on port: %u, errno=%u",
(int)xListenSockFd, pcStr, (unsigned)xConfig.usPort, (unsigned)errno);
break;