ports/security/gvm-libs/patches/patch-base_hosts_c

40 lines
1.5 KiB
Text

Index: base/hosts.c
--- base/hosts.c.orig
+++ base/hosts.c
@@ -34,7 +34,6 @@
#include <arpa/inet.h> /* for inet_pton, inet_ntop */
#include <assert.h> /* for assert */
#include <ctype.h> /* for isdigit */
-#include <malloc.h>
#include <netdb.h> /* for getnameinfo, NI_NAMEREQD */
#include <stdint.h> /* for uint8_t, uint32_t */
#include <stdio.h> /* for sscanf, perror */
@@ -1472,8 +1471,8 @@ gvm_hosts_resolve (gvm_hosts_t *hosts)
gvm_vhost_t *vhost;
new = gvm_host_new ();
- if (ip6->s6_addr32[0] != 0 || ip6->s6_addr32[1] != 0
- || ip6->s6_addr32[2] != htonl (0xffff))
+ if (ip6->s6_addr[0] != 0 || ip6->s6_addr[1] != 0
+ || ip6->s6_addr[2] != 0xff)
{
new->type = HOST_TYPE_IPV6;
memcpy (&new->addr6, ip6, sizeof (new->addr6));
@@ -1481,7 +1480,7 @@ gvm_hosts_resolve (gvm_hosts_t *hosts)
else
{
new->type = HOST_TYPE_IPV4;
- memcpy (&new->addr6, &ip6->s6_addr32[3], sizeof (new->addr));
+ memcpy (&new->addr6, &ip6->s6_addr[12], sizeof (new->addr));
}
vhost =
gvm_vhost_new (g_strdup (host->name), g_strdup ("Forward-DNS"));
@@ -2040,7 +2039,7 @@ gvm_duplicate_host (gvm_host_t *host)
ret->addr.s_addr = host->addr.s_addr;
break;
case HOST_TYPE_IPV6:
- ret->addr6.__in6_u = host->addr6.__in6_u;
+ ret->addr6.__u6_addr = host->addr6.__u6_addr;
break;
default:
g_free (ret);