diff options
author | Jose Alonso Cardenas Marquez <acm@FreeBSD.org> | 2022-08-01 13:38:43 -0500 |
---|---|---|
committer | Jose Alonso Cardenas Marquez <acm@FreeBSD.org> | 2022-08-01 13:41:44 -0500 |
commit | 0898eafb807f2779d3efb03c861f3e532664c1e2 (patch) | |
tree | 3c37bcdf282a9cea37b3161ab0e8e478f3d15fee /security/gvm-libs/files/patch-base_hosts.c | |
parent | security/py-gvm-tools: update to 22.6.1 (diff) |
security/gvm-libs: update to 22.4.0
ChangeLog at: https://github.com/greenbone/gvm-libs/releases/tag/v22.4.0
Diffstat (limited to 'security/gvm-libs/files/patch-base_hosts.c')
-rw-r--r-- | security/gvm-libs/files/patch-base_hosts.c | 57 |
1 files changed, 22 insertions, 35 deletions
diff --git a/security/gvm-libs/files/patch-base_hosts.c b/security/gvm-libs/files/patch-base_hosts.c index 20cdbd489f1a..45a12c4a803d 100644 --- a/security/gvm-libs/files/patch-base_hosts.c +++ b/security/gvm-libs/files/patch-base_hosts.c @@ -1,61 +1,48 @@ ---- base/hosts.c 2021-10-11 09:38:23.000000000 -0500 -+++ base/hosts.c 2021-10-27 21:07:36.955872000 -0500 -@@ -34,11 +34,11 @@ +--- base/hosts.c 2022-07-18 03:40:56.000000000 -0500 ++++ base/hosts.c 2022-07-31 17:50:48.439636000 -0500 +@@ -34,7 +34,11 @@ #include <arpa/inet.h> /* for inet_pton, inet_ntop */ #include <assert.h> /* for assert */ #include <ctype.h> /* for isdigit */ --#include <malloc.h> ++#if defined(__FreeBSD__) ++#include <malloc_np.h> ++#else + #include <malloc.h> ++#endif #include <netdb.h> /* for getnameinfo, NI_NAMEREQD */ #include <stdint.h> /* for uint8_t, uint32_t */ #include <stdio.h> /* for sscanf, perror */ - #include <stdlib.h> /* for strtol, atoi */ -+#include <malloc_np.h> - #include <string.h> /* for strchr, memcpy, memcmp, bzero, strcasecmp */ - #include <sys/socket.h> /* for AF_INET, AF_INET6, sockaddr */ - -@@ -1092,7 +1092,7 @@ - hosts->count -= duplicates; - hosts->duplicated += duplicates; - hosts->current = 0; -- malloc_trim (0); -+ // malloc_trim (0); - } - - /** -@@ -1287,7 +1287,7 @@ - gvm_hosts_deduplicate (hosts); - - g_strfreev (split); -- malloc_trim (0); -+ //malloc_trim (0); - return hosts; - } - -@@ -1467,8 +1467,8 @@ +@@ -1472,8 +1476,13 @@ 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 ++#if defined(__FreeBSD__) ++ if (ip6->s6_addr[0] != 0 || ip6->s6_addr[1] != 0 + || ip6->s6_addr[2] != 0xff) ++#else + if (ip6->s6_addr32[0] != 0 || ip6->s6_addr32[1] != 0 + || ip6->s6_addr32[2] != htonl (0xffff)) ++#endif { new->type = HOST_TYPE_IPV6; memcpy (&new->addr6, ip6, sizeof (new->addr6)); -@@ -1476,7 +1476,7 @@ +@@ -1481,7 +1490,11 @@ else { new->type = HOST_TYPE_IPV4; -- memcpy (&new->addr6, &ip6->s6_addr32[3], sizeof (new->addr)); ++#if defined(__FreeBSD__) + memcpy (&new->addr6, &ip6->s6_addr[12], sizeof (new->addr)); ++#else + memcpy (&new->addr6, &ip6->s6_addr32[3], sizeof (new->addr)); ++#endif } vhost = gvm_vhost_new (g_strdup (host->name), g_strdup ("Forward-DNS")); -@@ -2034,7 +2034,11 @@ +@@ -2040,7 +2053,11 @@ ret->addr.s_addr = host->addr.s_addr; break; case HOST_TYPE_IPV6: -+#if defined (__FreeBSD__) ++#if defined(__FreeBSD__) + ret->addr6.__u6_addr = host->addr6.__u6_addr; +#else ret->addr6.__in6_u = host->addr6.__in6_u; |