Skip to content

Commit

Permalink
HPCC-29990 Getaddrinfo call set hints.ai_family to AF_INET unless IP6…
Browse files Browse the repository at this point in the history
…preferred

Signed-off-by: Mark Kelly <[email protected]>
  • Loading branch information
mckellyln committed Jul 31, 2023
1 parent 268f455 commit f4c7ce8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions system/jlib/jsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3530,6 +3530,9 @@ static bool lookupHostAddress(const char *name,unsigned *netaddr)
struct addrinfo *addrInfo = NULL;
for (;;) {
memset(&hints,0,sizeof(hints));
// dont wait for both A and AAAA records ...
if (IP4only || (!IP6preferred))
hints.ai_family = AF_INET;
int ret = getaddrinfo(name, NULL , &hints, &addrInfo);
if (!ret)
break;
Expand Down

0 comments on commit f4c7ce8

Please sign in to comment.