From ce999cd476e1be3d1be12a779d79098ea8d04642 Mon Sep 17 00:00:00 2001 From: pkova Date: Thu, 19 Oct 2023 22:07:50 +0300 Subject: [PATCH] ames: resolve galaxy ips using ipv4 only --- pkg/vere/io/ames.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/pkg/vere/io/ames.c b/pkg/vere/io/ames.c index 24baa6e042..6df308239b 100644 --- a/pkg/vere/io/ames.c +++ b/pkg/vere/io/ames.c @@ -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); } } @@ -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);