fix: ip return issue

This commit is contained in:
dapan1121 2024-07-25 17:56:51 +08:00
parent bd55075948
commit 9fc45cf429
1 changed files with 3 additions and 1 deletions

View File

@ -998,7 +998,7 @@ int32_t taosGetIpv4FromFqdn(const char *fqdn, uint32_t* ip) {
struct sockaddr *sa = result->ai_addr;
struct sockaddr_in *si = (struct sockaddr_in *)sa;
struct in_addr ia = si->sin_addr;
uint32_t ip = ia.s_addr;
*ip = ia.s_addr;
freeaddrinfo(result);
return 0;
} else {
@ -1011,6 +1011,8 @@ int32_t taosGetIpv4FromFqdn(const char *fqdn, uint32_t* ip) {
#else
// printf("failed to get the ip address, fqdn:%s, ret:%d, since:%s", fqdn, ret, gai_strerror(ret));
#endif
*ip = 0xFFFFFFFF;
return 0xFFFFFFFF;
}
#endif