Hi,
If possible, could you help on this issue? When make under Debian 11, lots of warning. IPv4 is ok, but not to be able use for IPv6.
gcc -c -O2 -Wall -g main.c
main.c: In function ‘main’:
main.c:209:3: warning: implicit declaration of function ‘resolve6’; did you mean ‘resolve’? [-Wimplicit-function-declaration]
resolve6((struct sockaddr*)&remote, targetname);
^~~~~~~~
resolve
gcc -c -O2 -Wall -g getifname.c
gcc -c -O2 -Wall -g getlhs.c
gcc -c -O2 -Wall -g linux_sockpacket.c
gcc -c -O2 -Wall -g parseoptions.c
gcc -c -O2 -Wall -g datafiller.c
gcc -c -O2 -Wall -g datahandler.c
gcc -c -O2 -Wall -g gethostname.c
gcc -c -O2 -Wall -g binding.c
gcc -c -O2 -Wall -g getusec.c
gcc -c -O2 -Wall -g opensockraw.c
gcc -c -O2 -Wall -g logicmp.c
gcc -c -O2 -Wall -g waitpacket.c
waitpacket.c: In function ‘handle_ipv6’:
waitpacket.c:194:11: warning: implicit declaration of function ‘recv_icmp6’; did you mean ‘recv_icmp’? [-Wimplicit-function-declaration]
return recv_icmp6(enc_packet, enc_size);
^~~~~~~~~~
recv_icmp
waitpacket.c: In function ‘recv_icmp6’:
waitpacket.c:439:4: warning: implicit declaration of function ‘log_icmp6_unreach’; did you mean ‘log_icmp_unreach’? [-Wimplicit-function-declaration]
log_icmp6_unreach(inet_ntop(opt_af, &src6, tmp, sizeof(tmp)), icmp->code);
^~~~~~~~~~~~~~~~~
log_icmp_unreach
waitpacket.c:444:4: warning: implicit declaration of function ‘log_icmp6_ptb’; did you mean ‘log_icmp_ts’? [-Wimplicit-function-declaration]
log_icmp6_ptb(inet_ntop(opt_af, &src6, tmp, sizeof(tmp)), ntohl(icmp->un.mtu));
^~~~~~~~~~~~~
log_icmp_ts
waitpacket.c: In function ‘recv_tcp’:
waitpacket.c:742:16: warning: ‘tstamp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
sec = tstamp/hz; /* Get the uptime in seconds /
~~~~~~^~~
waitpacket.c:678:8: note: ‘tstamp’ was declared here
__u32 tstamp, echo;
^~~~~~
gcc -c -O2 -Wall -g resolve.c
gcc -c -O2 -Wall -g sendip.c
gcc -c -O2 -Wall -g sendip6.c
gcc -c -O2 -Wall -g sendicmp.c
sendicmp.c: In function ‘send_icmp_other’:
sendicmp.c:258:2: warning: ‘memcpy’ forming offset [21, 28] is out of the bounds [0, 20] of object ‘icmp_ip’ with type ‘struct myiphdr’ [-Warray-bounds]
memcpy(packet+ICMPHDR_SIZE, &icmp_ip, left_space);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sendicmp.c:199:17: note: ‘icmp_ip’ declared here
struct myiphdr icmp_ip;
^~~~~~~
gcc -c -O2 -Wall -g sendicmp6.c
sendicmp6.c: In function ‘send_icmp_other’:
sendicmp6.c:168:2: warning: ‘memcpy’ forming offset [21, 28] is out of the bounds [0, 20] of object ‘icmp_ip’ with type ‘struct myiphdr’ [-Warray-bounds]
memcpy(packet+ICMPHDR_SIZE, &icmp_ip, left_space);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sendicmp6.c:112:17: note: ‘icmp_ip’ declared here
struct myiphdr icmp_ip;
^~~~~~~
gcc -c -O2 -Wall -g sendudp.c
gcc -c -O2 -Wall -g sendtcp.c
gcc -c -O2 -Wall -g cksum.c
gcc -c -O2 -Wall -g statistics.c
gcc -c -O2 -Wall -g usage.c
gcc -c -O2 -Wall -g version.c
gcc -c -O2 -Wall -g antigetopt.c
gcc -c -O2 -Wall -g sockopt.c
gcc -c -O2 -Wall -g listen.c
gcc -c -O2 -Wall -g sendhcmp.c
gcc -c -O2 -Wall -g memstr.c
gcc -c -O2 -Wall -g rtt.c
rtt.c: In function ‘rtt’:
rtt.c:41:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
for (i=0; i<TABLESIZE; i++)
^~~
rtt.c:46:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
if (i != TABLESIZE)
^~
gcc -c -O2 -Wall -g relid.c
gcc -c -O2 -Wall -g sendip_handler.c
sendip_handler.c: In function ‘send_ip_handler’:
sendip_handler.c:20:3: warning: implicit declaration of function ‘send_ip6’; did you mean ‘send_ip’? [-Wimplicit-function-declaration]
send_ip6((char)&ADDR6(&local),
^~~~~~~~
send_ip
gcc -c -O2 -Wall -g libpcap_stuff.c
gcc -c -O2 -Wall -g memlockall.c
gcc -c -O2 -Wall -g memunlockall.c
gcc -c -O2 -Wall -g memlock.c
gcc -c -O2 -Wall -g memunlock.c
gcc -c -O2 -Wall -g ip_opt_build.c
ip_opt_build.c: In function ‘ip_opt_build’:
ip_opt_build.c:26:29: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
memset(ip_opt, 1, sizeof(ip_opt));
^
gcc -c -O2 -Wall -g display_ipopt.c
gcc -c -O2 -Wall -g sendrawip.c
gcc -c -O2 -Wall -g signal.c
gcc -c -O2 -Wall -g send.c
send.c: In function ‘send_packet’:
send.c:163:37: warning: implicit declaration of function ‘send_icmp6’; did you mean ‘send_icmp’? [-Wimplicit-function-declaration]
else if (opt_icmpmode){if(opt_ipv6)send_icmp6(); else send_icmp();}
^~~~~~~~~~
send_icmp
At top level:
send.c:99:13: warning: ‘select_next_random_ipv6_dest_simple’ defined but not used [-Wunused-function]
static void select_next_random_ipv6_dest_simple(void)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
send.c:90:13: warning: ‘select_next_random_ipv6_source_simple’ defined but not used [-Wunused-function]
static void select_next_random_ipv6_source_simple(void)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -c -O2 -Wall -g strlcpy.c
gcc -c -O2 -Wall -g arsglue.c
gcc -c -O2 -Wall -g random.c
gcc -c -O2 -Wall -g random6.c
gcc -c -O2 -Wall -g scan.c
scan.c: In function ‘receiver’:
scan.c:455:6: warning: pointer targets in assignment from ‘char *’ to ‘unsigned char *’ differ in signedness [-Wpointer-sign]
p = packet+linkhdr_size+iphdrlen;
^
In function ‘receiver.isra.0’,
inlined from ‘scanmain’ at scan.c:541:3:
scan.c:456:4: warning: ‘memcpy’ forming offset [9, 20] is out of the bounds [0, 8] of object ‘icmp’ with type ‘struct myicmphdr’ [-Warray-bounds]
memcpy(&icmp, p, sizeof(subtcp));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scan.c: In function ‘scanmain’:
scan.c:442:21: note: ‘icmp’ declared here
struct myicmphdr icmp;
^~~~
gcc -c -O2 -Wall -g hstring.c
gcc -c -O2 -Wall -g ars.c
ars.c: In function ‘ars_add_icmphdr’:
ars.c:295:22: warning: variable ‘icmp’ set but not used [-Wunused-but-set-variable]
struct ars_icmphdr *icmp;
^~~~
In file included from ars.c:15:
ars.c: In function ‘ars_multi_cksum’:
ars.c:433:46: warning: comparison with string literal results in unspecified behavior [-Waddress]
assert("else reached in ars_multi_cksum()" == "");
^~
ars.c:433:46: warning: comparison with string literal results in unspecified behavior [-Waddress]
assert("else reached in ars_multi_cksum()" == "");
^~
ars.c: In function ‘ars_bsd_fix’:
ars.c:825:20: warning: variable ‘ip’ set but not used [-Wunused-but-set-variable]
struct ars_iphdr *ip;
^~
gcc -c -O2 -Wall -g apd.c
gcc -c -O2 -Wall -g split.c
/usr/bin/ar rc libars.a ars.o apd.o split.o
/usr/bin/ranlib libars.a
gcc -o hping6 -O2 -Wall -g main.o getifname.o getlhs.o linux_sockpacket.o parseoptions.o datafiller.o datahandler.o gethostname.o binding.o getusec.o opensockraw.o logicmp.o waitpacket.o resolve.o sendip.o sendip6.o sendicmp.o sendicmp6.o sendudp.o sendtcp.o cksum.o statistics.o usage.o version.o antigetopt.o sockopt.o listen.o sendhcmp.o memstr.o rtt.o relid.o sendip_handler.o libpcap_stuff.o memlockall.o memunlockall.o memlock.o memunlock.o ip_opt_build.o display_ipopt.o sendrawip.o signal.o send.o strlcpy.o arsglue.o random.o random6.o scan.o hstring.o libars.a
./hping6 -v
hping version 3.0.0-koszik (Sun Apr 16 07:19:17 CEST 2006)
linux sockpacket based binary
use make strip' to strip hping6 binary use
make install' to install hping6