diff --git a/freemodbus/tcp_master/port/port_tcp_master.c b/freemodbus/tcp_master/port/port_tcp_master.c index 665d039..9cdb535 100644 --- a/freemodbus/tcp_master/port/port_tcp_master.c +++ b/freemodbus/tcp_master/port/port_tcp_master.c @@ -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; } diff --git a/freemodbus/tcp_slave/port/port_tcp_slave.c b/freemodbus/tcp_slave/port/port_tcp_slave.c index ed11d59..97d99a2 100644 --- a/freemodbus/tcp_slave/port/port_tcp_slave.c +++ b/freemodbus/tcp_slave/port/port_tcp_slave.c @@ -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();