提交 1a3eaa80 编写于 作者: D Daniel P. Berrange

Replace use of 'in_addr_t' with 'struct in_addr'

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: NDaniel P. Berrange <berrange@redhat.com>
上级 027a7707
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册