Skip to content

Commit

Permalink
ames: resolve galaxy ips using ipv4 only
Browse files Browse the repository at this point in the history
  • Loading branch information
pkova committed Oct 19, 2023
1 parent 9097efb commit ce999cd
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions pkg/vere/io/ames.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,17 +1030,9 @@ _ames_czar_cb(uv_getaddrinfo_t* adr_u,
struct addrinfo* rai_u = aif_u;
time_t now = time(0);

while ( rai_u ) {
if ( (AF_INET == rai_u->ai_family) ) {
_ames_czar_here(pac_u, now, (struct sockaddr_in *)rai_u->ai_addr);
break;
}
else {
rai_u = rai_u->ai_next;
}
}

if ( !rai_u ) {
if ( sas_i == 0 ) {
_ames_czar_here(pac_u, now, (struct sockaddr_in *)rai_u->ai_addr);
} else {
_ames_czar_gone(pac_u, now);
}
}
Expand Down Expand Up @@ -1128,9 +1120,13 @@ _ames_czar(u3_pact* pac_u)
uv_getaddrinfo_t* adr_u = c3_malloc(sizeof(*adr_u));
adr_u->data = pac_u;

struct addrinfo hints;
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET; // only IPv4 addresses

if ( 0 != (sas_i = uv_getaddrinfo(u3L, adr_u,
_ames_czar_cb,
pac_u->rut_u.dns_c, 0, 0)) )
pac_u->rut_u.dns_c, 0, &hints)) )
{
u3l_log("ames: %s", uv_strerror(sas_i));
_ames_czar_gone(pac_u, now);
Expand Down

0 comments on commit ce999cd

Please sign in to comment.