mirror of
https://github.com/espressif/esp-modbus.git
synced 2025-07-30 18:37:16 +02:00
modbus fix check of host name
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user