modbus fix check of host name

This commit is contained in:
aleks
2024-06-06 13:33:24 +02:00
parent f81ef8229e
commit 1978b071c1
2 changed files with 2 additions and 8 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

@ -381,13 +381,7 @@ vMBTCPPortBindAddr(const CHAR* pcBindIp)
xHint.ai_socktype = (xConfig.eMbProto == MB_PROTO_UDP) ? SOCK_DGRAM : SOCK_STREAM;
// The LWIP has an issue when connection to IPv6 socket
xHint.ai_protocol = (xConfig.eMbProto == MB_PROTO_UDP) ? IPPROTO_UDP : IPPROTO_TCP;
xHint.ai_flags = AI_NUMERICSERV;
if (pcBindIp == NULL) {
xHint.ai_flags |= AI_PASSIVE;
} else {
xHint.ai_flags |= AI_CANONNAME;
}
xHint.ai_flags = AI_NUMERICSERV | AI_PASSIVE | AI_CANONNAME;
if (asprintf(&pcStr, "%u", xConfig.usPort) == -1) {
abort();