From 9056229f9dff923406d97f0ac295bd502eaa5265 Mon Sep 17 00:00:00 2001
From: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Date: Mon, 13 Apr 2020 16:48:43 +0300
Subject: [PATCH 2/8] util: fix iteration in virSocketAddrResolveService

getaddrinfo returns linked list. Fix iteration accordingly.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
(cherry-picked from commit a13ac587)
Signed-off-by: AlexChen <alex.chen@huawei.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 4cad329d15..4c9f124e88 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,
-- 
2.23.0

