On 4/13/20 11:18 AM, Nikolay Shirokovskiy wrote:
getaddrinfo returns linked list. Fix iteration accordingly.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
Reviewed-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
src/util/virsocketaddr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c
index 4cad329..4c9f124 100644
--- a/src/util/virsocketaddr.c
+++ b/src/util/virsocketaddr.c
@@ -271,7 +271,7 @@ int virSocketAddrResolveService(const char *service)
port = ntohs(in.sin6_port);
goto cleanup;
}
- tmp++;
+ tmp = tmp->ai_next;
}
virReportError(VIR_ERR_SYSTEM_ERROR,