Re: [PATCH] util: fix iteration in virSocketAddrResolveService

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

 





On 4/13/20 11:18 AM, Nikolay Shirokovskiy wrote:
getaddrinfo returns linked list. Fix iteration accordingly.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
---

Reviewed-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>


  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,





[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