diff --git a/fping-2.4b2_ipv6-fix.diff b/fping-2.4b2_ipv6-fix.diff deleted file mode 100644 index 1a7c691..0000000 --- a/fping-2.4b2_ipv6-fix.diff +++ /dev/null @@ -1,88 +0,0 @@ ---- fping-2.4b2-to-ipv6.orig/fping.c -+++ fping-2.4b2-to-ipv6/fping.c -@@ -42,7 +42,6 @@ - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ --#define IPV6 1 /* This should be a compiler option, or even better be done from the Makefile... ;) */ - - #ifndef _NO_PROTO - #if !__STDC__ && !defined( __cplusplus ) && !defined( FUNCPROTO ) \ -@@ -150,7 +149,11 @@ - #define MIN_PING_DATA sizeof( PING_DATA ) - #define MAX_IP_PACKET 65536 /* (theoretical) max IP packet size */ - #define SIZE_IP_HDR 20 -+#ifndef IPV6 - #define SIZE_ICMP_HDR ICMP_MINLEN /* from ip_icmp.h */ -+#else -+#define SIZE_ICMP_HDR sizeof(FPING_ICMPHDR) -+#endif - #define MAX_PING_DATA ( MAX_IP_PACKET - SIZE_IP_HDR - SIZE_ICMP_HDR ) - - /* sized so as to be like traditional ping */ -@@ -474,6 +477,35 @@ - sizeof(opton))) - err(1, "setsockopt(IPV6_RTHDR)"); - #endif -+#ifndef USE_SIN6_SCOPE_ID -+#ifdef IPV6_RECVPKTINFO -+ if (setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &opton, -+ sizeof(opton))) -+ err(1, "setsockopt(IPV6_RECVPKTINFO)"); -+#else /* old adv. API */ -+ if (setsockopt(s, IPPROTO_IPV6, IPV6_PKTINFO, &opton, -+ sizeof(opton))) -+ err(1, "setsockopt(IPV6_PKTINFO)"); -+#endif -+#endif /* USE_SIN6_SCOPE_ID */ -+#ifdef IPV6_RECVHOPLIMIT -+ if (setsockopt(s, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &opton, -+ sizeof(opton))) -+ err(1, "setsockopt(IPV6_RECVHOPLIMIT)"); -+#else /* old adv. API */ -+ if (setsockopt(s, IPPROTO_IPV6, IPV6_HOPLIMIT, &opton, -+ sizeof(opton))) -+ err(1, "setsockopt(IPV6_HOPLIMIT)"); -+#endif -+#ifdef IPV6_CHECKSUM -+#ifndef SOL_RAW -+#define SOL_RAW IPPROTO_IPV6 -+#endif -+ opton = 2; -+ if (setsockopt(s, SOL_RAW, IPV6_CHECKSUM, &opton, -+ sizeof(opton))) -+ err(1, "setsockopt(SOL_RAW,IPV6_CHECKSUM)"); -+#endif - #endif - - if( ( uid = getuid() ) ) -@@ -1382,8 +1414,8 @@ - if( h->num_recv_i <= h->num_sent_i ) - { - fprintf( stderr, " xmt/rcv/%%loss = %d/%d/%d%%", -- h->num_sent_i, h->num_recv_i, -- ( ( h->num_sent_i - h->num_recv_i ) * 100 ) / h->num_sent_i ); -+ h->num_sent_i, h->num_recv_i, h->num_sent_i > 0 ? -+ ( ( h->num_sent_i - h->num_recv_i ) * 100 ) / h->num_sent_i : 0 ); - - }/* IF */ - else -@@ -2165,6 +2197,7 @@ - struct addrinfo *res, hints; - int ret_ga; - char *hostname; -+ size_t len; - - /* getaddrinfo */ - bzero(&hints, sizeof(struct addrinfo)); -@@ -2178,7 +2211,9 @@ - if (res->ai_canonname) hostname = res->ai_canonname; - else hostname = name; - if (!res->ai_addr) errx(1, "getaddrinfo failed"); -- (void)memcpy(&dst, res->ai_addr, sizeof(FPING_SOCKADDR)); /*res->ai_addrlen);*/ -+ len = res->ai_addrlen; -+ if (len > sizeof(FPING_SOCKADDR)) len = sizeof(FPING_SOCKADDR); -+ (void)memcpy(&dst, res->ai_addr, len); - add_addr(name, name, &dst); - #endif - } /* add_name() */ diff --git a/fping-2.4b2_to-ipv6-capnetraw.patch b/fping-2.4b2_to-ipv6-capnetraw.patch deleted file mode 100644 index 44d4fb6..0000000 --- a/fping-2.4b2_to-ipv6-capnetraw.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff -up fping-2.4b2_to-ipv6/fping.8.capnetraw fping-2.4b2_to-ipv6/fping.8 ---- fping-2.4b2_to-ipv6/fping.8.capnetraw 2002-01-20 20:05:48.000000000 -0500 -+++ fping-2.4b2_to-ipv6/fping.8 2011-09-04 16:14:03.782482153 -0400 -@@ -88,10 +88,7 @@ fping a list of IP addresses as input an - .IP \fB-e\fR 5 - Show elapsed (round-trip) time of packets. - .IP \fB-f\fR 5 --Read list of targets from a file. This option can only be used by the --root user. Regular users should pipe in the file via stdin: -- --% fping < targets_file -+Read list of targets from a file. - - .IP \fB-g\fR 5 - Generate a target list from a supplied IP netmask, or a starting and ending IP. -@@ -203,11 +200,9 @@ command line arguments, and 4 for a syst - Ha! If we knew of any we would have fixed them! - .SH RESTRICTIONS - If certain options are used (i.e, a low value for -i and -t, and a --high value for -r) it is possible to flood the network. This program --must be installed as setuid root in order to open up a raw socket, --or must be run by root. In order to stop mere mortals from hosing the --network (when fping is installed setuid root) , normal users can't specify --the following: -+high value for -r) it is possible to flood the network. In order to -+stop mere mortals from hosing the network (when fping is installed -+setuid root), normal users can't specify the following: - .nf - - -i n where n < 10 msec -diff -up fping-2.4b2_to-ipv6/fping.c.capnetraw fping-2.4b2_to-ipv6/fping.c ---- fping-2.4b2_to-ipv6/fping.c.capnetraw 2011-09-04 15:06:08.800668963 -0400 -+++ fping-2.4b2_to-ipv6/fping.c 2011-09-04 15:11:15.256781273 -0400 -@@ -410,17 +410,6 @@ int main( int argc, char **argv ) - int advance; - struct protoent *proto; - char *buf; -- uid_t uid; -- /* check if we are root */ -- -- if( geteuid() ) -- { -- fprintf( stderr, -- "This program can only be run by root, or it must be setuid root.\n" ); -- -- exit( 3 ); -- -- }/* IF */ - - /* confirm that ICMP is available on this machine */ - #ifndef IPV6 -@@ -508,12 +497,6 @@ int main( int argc, char **argv ) - #endif - #endif - -- if( ( uid = getuid() ) ) -- { -- seteuid( getuid() ); -- -- }/* IF */ -- - prog = argv[0]; - ident = getpid() & 0xFFFF; -