diff options
Diffstat (limited to 'security/gvm-libs/files/patch-boreas_ping.c')
-rw-r--r-- | security/gvm-libs/files/patch-boreas_ping.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/security/gvm-libs/files/patch-boreas_ping.c b/security/gvm-libs/files/patch-boreas_ping.c index 6672c778a132..282c6b22e380 100644 --- a/security/gvm-libs/files/patch-boreas_ping.c +++ b/security/gvm-libs/files/patch-boreas_ping.c @@ -1,6 +1,6 @@ ---- boreas/ping.c 2021-04-15 09:22:56.000000000 -0500 -+++ boreas/ping.c 2021-06-14 19:24:32.398090000 -0500 -@@ -26,9 +26,13 @@ +--- boreas/ping.c 2022-07-18 03:40:56.000000000 -0500 ++++ boreas/ping.c 2022-07-31 17:59:55.449717000 -0500 +@@ -27,9 +27,13 @@ #include <errno.h> #include <glib.h> #include <ifaddrs.h> /* for getifaddrs() */ @@ -14,7 +14,7 @@ #include <netinet/ip6.h> #include <netinet/ip_icmp.h> #include <netinet/tcp.h> -@@ -36,7 +40,6 @@ +@@ -37,7 +41,6 @@ #include <sys/ioctl.h> #include <sys/socket.h> #include <sys/time.h> @@ -22,7 +22,7 @@ #include <unistd.h> #undef G_LOG_DOMAIN -@@ -105,7 +108,11 @@ +@@ -106,7 +109,11 @@ int cur_so_sendbuf = -1; /* Get the current size of the output queue size */ @@ -34,7 +34,7 @@ { g_warning ("%s: ioctl error: %s", __func__, strerror (errno)); usleep (100000); -@@ -121,7 +128,11 @@ +@@ -122,7 +129,11 @@ while (cur_so_sendbuf >= so_sndbuf) { usleep (100000); @@ -46,7 +46,7 @@ { g_warning ("%s: ioctl error: %s", __func__, strerror (errno)); usleep (100000); -@@ -208,12 +219,23 @@ +@@ -209,12 +220,22 @@ static int init = -1; icmp = (struct icmphdr *) sendbuf; @@ -58,7 +58,6 @@ icmp->code = 0; +#endif -+ len = 8 + datalen; +#ifdef __FreeBSD__ + icmp->icmp_cksum = 0; @@ -70,19 +69,20 @@ memset (&soca, 0, sizeof (soca)); soca.sin_family = AF_INET; -@@ -276,7 +298,11 @@ - } - else - { +@@ -287,7 +308,11 @@ + } + else + { +- dst4.s_addr = dst6_p->s6_addr32[3]; +#ifdef __FreeBSD__ + dst4.s_addr = dst6_p->s6_addr[12]; +#else - dst4.s_addr = dst6_p->s6_addr32[3]; ++ dst4.s_addr = dst6_p->s6_addr32[3]; +#endif - send_icmp_v4 (scanner->icmpv4soc, dst4_p); - } - } -@@ -538,7 +564,11 @@ + send_icmp_v4 (scanner->icmpv4soc, dst4_p); + } + if (grace_period > 0) +@@ -552,7 +577,11 @@ } else { @@ -94,12 +94,15 @@ send_tcp_v4 (scanner, dst4_p); } } -@@ -588,7 +618,7 @@ +@@ -602,7 +631,11 @@ /* Need to transform the IPv6 mapped IPv4 address back to an IPv4 string. * We can not just use the host_value_str as it might be an IPv4 mapped * IPv6 string. */ -- if (inet_ntop (AF_INET, &(dst6_p->s6_addr32[3]), ipv4_str, ++#if defined(__FreeBSD__) + if (inet_ntop (AF_INET, &(dst6_p->s6_addr[12]), ipv4_str, ++#else + if (inet_ntop (AF_INET, &(dst6_p->s6_addr32[3]), ipv4_str, ++#endif sizeof (ipv4_str)) == NULL) { |