From c6c2a834ca70006f17e3e74196ea08935cae7b3e Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Wed, 14 Oct 2015 20:46:56 +0200 Subject: [PATCH] Fix fping6 -R (fixes #84) --- src/socket6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/socket6.c b/src/socket6.c index e4dd6db..f08086e 100644 --- a/src/socket6.c +++ b/src/socket6.c @@ -99,7 +99,7 @@ int socket_sendto_ping_ipv6(int s, struct sockaddr *saddr, socklen_t saddr_len, icp->icmp6_id = htons(icmp_id_nr); if (random_data_flag) { - for (n = ((void*)&icp->icmp6_data8 - (void *)icp); n < ping_pkt_size; ++n) { + for (n = sizeof(struct icmp6_hdr); n < ping_pkt_size; ++n) { ping_buffer[n] = random() & 0xFF; } }