freebsd-ports/security/openvas8-libraries/files/patch-nasl-nasl_packet_forgery.c
Jose Alonso Cardenas Marquez 29c543f285 - Rename openvas ports for reflect 8 version in name. I'll add openvas9 ports
and I'll take maintainership of them
2017-08-03 22:21:37 +00:00

56 lines
1.8 KiB
C

--- nasl/nasl_packet_forgery.c.orig 2015-08-03 10:14:31 UTC
+++ nasl/nasl_packet_forgery.c
@@ -146,7 +146,7 @@ forge_ip_packet (lex_ctxt * lexic)
if (s != NULL)
inet_aton (s, &pkt->ip_dst);
else
- pkt->ip_dst.s_addr = dst_addr->s6_addr32[3];
+ memcpy(&pkt->ip_dst.s_addr, &dst_addr->s6_addr[12], 4);
if (data != NULL)
{
@@ -1400,7 +1400,7 @@ nasl_tcp_ping (lex_ctxt * lexic)
if (dst == NULL || (IN6_IS_ADDR_V4MAPPED (dst) != 1))
return NULL;
- inaddr.s_addr = dst->s6_addr32[3];
+ memcpy(&inaddr.s_addr, &dst->s6_addr[12], 4);
for (i = 0; i < sizeof (sports) / sizeof (int); i++)
{
if (sports[i] == 0)
@@ -1422,7 +1422,7 @@ nasl_tcp_ping (lex_ctxt * lexic)
port = plug_get_host_open_port (script_infos);
if (islocalhost (&inaddr) > 0)
- src.s_addr = dst->s6_addr32[3];
+ memcpy(&src.s_addr, &dst->s6_addr[12], 4);
else
{
bzero (&src, sizeof (src));
@@ -1536,7 +1536,7 @@ nasl_send_packet (lex_ctxt * lexic)
if (dstip == NULL || (IN6_IS_ADDR_V4MAPPED (dstip) != 1))
return NULL;
- inaddr.s_addr = dstip->s6_addr32[3];
+ memcpy(&inaddr.s_addr, &dstip->s6_addr[12], 4);
soc = socket (AF_INET, SOCK_RAW, IPPROTO_RAW);
if (soc < 0)
return NULL;
@@ -1656,7 +1656,7 @@ nasl_pcap_next (lex_ctxt * lexic)
{
struct in_addr src;
bzero (&src, sizeof (src));
- inaddr.s_addr = dst->s6_addr32[3];
+ memcpy(&inaddr.s_addr, &dst->s6_addr[12], 4);
interface = routethrough (&inaddr, &src);
}
else
@@ -1791,7 +1791,7 @@ nasl_send_capture (lex_ctxt * lexic)
{
struct in_addr src;
bzero (&src, sizeof (src));
- inaddr.s_addr = dst->s6_addr32[3];
+ memcpy(&inaddr.s_addr, &dst->s6_addr[12], 4);
interface = routethrough (&inaddr, &src);
}
else