[PATCH] util: fix iteration in virSocketAddrResolveService

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



getaddrinfo returns linked list. Fix iteration accordingly.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
---
 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,
-- 
1.8.3.1






[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux