[PATCH] Replace use of 'in_addr_t' with 'struct in_addr'

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

The 'in_addr_t' typedef is not present in Mingw64 headers.
Instead we can use the more portable 'struct in_addr' and
then access its 's_addr' field.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/util/virsocketaddr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c
index 2666574..80b5c0b 100644
--- a/src/util/virsocketaddr.c
+++ b/src/util/virsocketaddr.c
@@ -235,10 +235,10 @@ virSocketAddrIsPrivate(const virSocketAddrPtr addr)
 bool
 virSocketAddrIsWildcard(const virSocketAddrPtr addr)
 {
-    in_addr_t tmp = INADDR_ANY;
+    struct in_addr tmp = { .s_addr = INADDR_ANY };
     switch (addr->data.stor.ss_family) {
     case AF_INET:
-        return memcmp(&addr->data.inet4.sin_addr.s_addr, &tmp,
+        return memcmp(&addr->data.inet4.sin_addr.s_addr, &tmp.s_addr,
                       sizeof(addr->data.inet4.sin_addr.s_addr)) == 0;
     case AF_INET6:
         return IN6_IS_ADDR_UNSPECIFIED(&addr->data.inet6.sin6_addr);
-- 
1.8.2.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]