1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
|
--- fping-2.4b2-to-ipv6.orig/fping.8
+++ fping-2.4b2-to-ipv6/fping.8
@@ -1,4 +1,4 @@
-.TH fping l
+.TH fping 8
.SH NAME
fping \- send ICMP ECHO_REQUEST packets to network hosts
.SH SYNOPSIS
@@ -12,9 +12,9 @@
.B fping
-is a
-.MS ping 8
-like program which uses the Internet Control
+is a program like
+.B ping(8)
+which uses the Internet Control
Message Protocol (ICMP) echo request to determine if a target host is
responding.
.B fping
@@ -37,8 +37,7 @@
).
.PP
Unlike
-.B ping
-,
+.B ping,
.B fping
is meant to be used in scripts, so its output is designed to be
easy to parse.
@@ -130,12 +129,16 @@
a target will be made, not including the first try.
.IP \fB-s\fR 5
Print cumulative statistics upon exit.
+.IP \fB-S\fIaddr\fR 5
+Set source address.
.IP \fB-t\fIn\fR 5
Initial target timeout in milliseconds (default 500). In the default
mode, this is the amount of time that
.B fping
waits for a response to its first request. Successive timeouts are
multiplied by the backoff factor.
+.IP \fB-T\fIn\fR 5
+Select timeout in seconds (default 10).
.IP \fB-u\fR 5
Show targets that are unreachable.
.IP \fB-v\fR 5
@@ -152,7 +155,7 @@
example none the less.
.nf
-#!/usr/local/bin/perl
+#!/usr/bin/perl
require 'open2.pl';
$MAILTO = "root";
@@ -178,7 +181,7 @@
that are currently reachable.
.nf
-#!/usr/local/bin/perl
+#!/usr/bin/perl
$hosts_to_backup = `cat /etc/hosts.backup | fping -a`;
--- fping-2.4b2-to-ipv6.orig/fping.c
+++ fping-2.4b2-to-ipv6/fping.c
@@ -24,7 +24,7 @@
*
* Original author: Roland Schemers <schemers@stanford.edu>
* IPv6 Support: Jeroen Massar <jeroen@unfix.org / jeroen@ipng.nl>
- *
+ * Bugfixes, byte order & senseful seq.-numbers: Stephan Fuhrmann (stephan.fuhrmann AT 1und1.de)
*
*
* RCS header information no longer used. It has been moved to the
@@ -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 ) \
@@ -101,13 +100,8 @@
#endif
#include <netinet/in_systm.h>
-/* Linux has bizarre ip.h and ip_icmp.h */
-#if defined( __linux__ )
-#include "linux.h"
-#else
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
-#endif /* defined(__linux__) */
#include <arpa/inet.h>
#include <netdb.h>
@@ -150,7 +144,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 */
@@ -192,7 +190,7 @@
"",
"",
"ICMP Time Exceeded", /* 11 */
- "ICMP Paramter Problem", /* 12 */
+ "ICMP Parameter Problem", /* 12 */
"ICMP Timestamp Request", /* 13 */
"ICMP Timestamp Reply", /* 14 */
"ICMP Information Request", /* 15 */
@@ -283,6 +281,12 @@
u_int count = 1;
u_int trials;
u_int report_interval = 0;
+int src_addr_present = 0;
+#ifndef IPV6
+struct in_addr src_addr;
+#else
+struct in6_addr src_addr;
+#endif
/* global stats */
long max_reply = 0;
@@ -292,6 +296,7 @@
int max_hostname_len = 0;
int num_jobs = 0; /* number of hosts still to do */
int num_hosts; /* total number of hosts */
+int max_seq_sent = 0; /* maximum sequence number sent so far */
int num_alive = 0, /* total number alive */
num_unreachable = 0, /* total number unreachable */
num_noaddress = 0; /* total number of addresses not found */
@@ -408,6 +413,11 @@
struct protoent *proto;
char *buf;
uid_t uid;
+#ifndef IPV6
+ struct sockaddr_in sa;
+#else
+ struct sockaddr_in6 sa;
+#endif
/* check if we are root */
if( geteuid() )
@@ -439,7 +449,7 @@
#ifdef IPV6
/*
- * let the kerel pass extension headers of incoming packets,
+ * let the kernel pass extension headers of incoming packets,
* for privileged socket options
*/
#ifdef IPV6_RECVHOPOPTS
@@ -474,6 +484,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() ) )
@@ -491,7 +530,7 @@
/* get command line options */
- while( ( c = getopt( argc, argv, "gedhlmnqusaAvz:t:i:p:f:r:c:b:C:Q:B:" ) ) != EOF )
+ while( ( c = getopt( argc, argv, "gedhlmnqusaAvz:t:i:p:f:r:c:b:C:Q:B:S:I:T:" ) ) != EOF )
{
switch( c )
{
@@ -502,7 +541,7 @@
break;
case 'r':
- if( !( retry = ( u_int )atoi( optarg ) ) )
+ if( ( retry = ( u_int )atoi( optarg ) ) < 0 )
usage();
break;
@@ -639,6 +678,33 @@
generate_flag = 1;
break;
+ case 'S':
+#ifndef IPV6
+ if( ! inet_pton( AF_INET, optarg, &src_addr ) )
+#else
+ if( ! inet_pton( AF_INET6, optarg, &src_addr ) )
+#endif
+ usage();
+ src_addr_present = 1;
+ break;
+
+ case 'I':
+#ifdef SO_BINDTODEVICE
+ if (setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE, optarg,
+ strlen(optarg)))
+ err(1, "setsockopt(AF_INET, SO_BINDTODEVICE)");
+#else
+ fprintf( stderr,
+ "Warning: SO_BINDTODEVICE not supported, argument -I %s ignored\n",
+ optarg );
+#endif
+ break;
+
+ case 'T':
+ if ( ! ( select_time = ( u_int )atoi( optarg ) * 100 ) )
+ usage();
+ break;
+
default:
usage();
break;
@@ -821,7 +887,7 @@
errno_crash_and_burn( "fopen" );
- while( fgets( line, 132, ping_file ) )
+ while( fgets( line, sizeof(line), ping_file ) )
{
if( sscanf( line, "%s", host ) != 1 )
continue;
@@ -962,6 +1028,22 @@
if( !num_hosts )
exit( 2 );
+ /* set the source address */
+
+ if( src_addr_present )
+ {
+ memset( &sa, 0, sizeof( sa ) );
+#ifndef IPV6
+ sa.sin_family = AF_INET;
+ sa.sin_addr = src_addr;
+#else
+ sa.sin6_family = AF_INET6;
+ sa.sin6_addr = src_addr;
+#endif
+ if ( bind( s, (struct sockaddr *)&sa, sizeof( sa ) ) < 0 )
+ errno_crash_and_burn( "cannot bind source address" );
+ }
+
/* allocate array to hold outstanding ping requests */
table = ( HOST_ENTRY** )malloc( sizeof( HOST_ENTRY* ) * num_hosts );
@@ -1112,7 +1194,7 @@
/* but allow time for the last one to come in */
if( count_flag )
{
- if( ( cursor->num_sent >= count ) && ( ht > cursor->timeout ) )
+ if( ( cursor->num_sent >= count ) && ( cursor->num_recv >= count || ht > cursor->timeout ) )
{
remove_job( cursor );
continue;
@@ -1153,6 +1235,7 @@
finish();
+ return 0;
} /* main() */
@@ -1382,15 +1465,15 @@
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
{
fprintf( stderr, " xmt/rcv/%%return = %d/%d/%d%%",
- h->num_sent_i, h->num_recv_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_recv_i * 100 ) / h->num_sent_i ) : 0 );
}/* ELSE */
@@ -1504,12 +1587,15 @@
icp = ( FPING_ICMPHDR* )buffer;
gettimeofday( &h->last_send_time, &tz );
+ int myseq = h->num_sent * num_hosts + h->i;
+ max_seq_sent = myseq > max_seq_sent ? myseq : max_seq_sent;
+
#ifndef IPV6
icp->icmp_type = ICMP_ECHO;
icp->icmp_code = 0;
icp->icmp_cksum = 0;
- icp->icmp_seq = h->i;
- icp->icmp_id = ident;
+ icp->icmp_seq = htons(myseq);
+ icp->icmp_id = htons(ident);
pdp = ( PING_DATA* )( buffer + SIZE_ICMP_HDR );
pdp->ping_ts = h->last_send_time;
@@ -1519,8 +1605,8 @@
#else
icp->icmp6_type = ICMP6_ECHO_REQUEST;
icp->icmp6_code = 0;
- icp->icmp6_seq = h->i;
- icp->icmp6_id = ident;
+ icp->icmp6_seq = htons(myseq);
+ icp->icmp6_id = htons(ident);
pdp = ( PING_DATA* )( buffer + SIZE_ICMP_HDR );
pdp->ping_ts = h->last_send_time;
@@ -1667,25 +1753,25 @@
}/* IF */
#ifndef IPV6
- if( icp->icmp_id != ident )
+ if( ntohs(icp->icmp_id) != ident )
#else
- if( icp->icmp6_id != ident )
+ if( ntohs(icp->icmp6_id) != ident )
#endif
return 1; /* packet received, but not the one we are looking for! */
num_pingreceived++;
#ifndef IPV6
- if( icp->icmp_seq >= ( n_short )num_hosts )
+ if( ntohs(icp->icmp_seq) > max_seq_sent )
#else
- if( icp->icmp6_seq >= ( n_short )num_hosts )
+ if( ntohs(icp->icmp6_seq) > max_seq_sent )
#endif
return( 1 ); /* packet received, don't worry about it anymore */
#ifndef IPV6
- n = icp->icmp_seq;
+ n = ntohs(icp->icmp_seq) % num_hosts;
#else
- n = icp->icmp6_seq;
+ n = ntohs(icp->icmp6_seq) % num_hosts;
#endif
h = table[n];
@@ -1824,6 +1910,7 @@
}/* IF */
+ fflush( stdout );
return num_jobs;
} /* wait_for_reply() */
@@ -1875,11 +1962,11 @@
sent_icmp = ( struct icmp* )( c + 28 );
if( ( sent_icmp->icmp_type == ICMP_ECHO ) &&
- ( sent_icmp->icmp_id == ident ) &&
- ( sent_icmp->icmp_seq < ( n_short )num_hosts ) )
+ ( ntohs(sent_icmp->icmp_id) == ident ) &&
+ ( ntohs(sent_icmp->icmp_seq) <= ( n_short )max_seq_sent ) )
{
/* this is a response to a ping we sent */
- h = table[sent_icmp->icmp_seq];
+ h = table[ntohs(sent_icmp->icmp_seq) % num_hosts];
if( p->icmp_code > ICMP_UNREACH_MAXTYPE )
{
@@ -1888,11 +1975,11 @@
#else
if( ( sent_icmp->icmp6_type == ICMP_ECHO ) &&
- ( sent_icmp->icmp6_id == ident ) &&
- ( sent_icmp->icmp6_seq < ( n_short )num_hosts ) )
+ ( ntohs(sent_icmp->icmp6_id) == ident ) &&
+ ( ntohs(sent_icmp->icmp6_seq) <= ( n_short )max_seq_sent ) )
{
/* this is a response to a ping we sent */
- h = table[sent_icmp->icmp6_seq];
+ h = table[ntohs(sent_icmp->icmp6_seq) % num_hosts];
if( p->icmp6_code > ICMP_UNREACH_MAXTYPE )
{
@@ -1930,24 +2017,24 @@
case ICMP_PARAMPROB:
sent_icmp = ( FPING_ICMPHDR* )( c + 28 );
#ifndef IPV6
- if( ( sent_icmp->icmp_type = ICMP_ECHO ) &&
- ( sent_icmp->icmp_id = ident ) &&
- ( sent_icmp->icmp_seq < ( n_short )num_hosts ) )
+ if( ( sent_icmp->icmp_type == ICMP_ECHO ) &&
+ ( ntohs(sent_icmp->icmp_id) == ident ) &&
+ ( ntohs(sent_icmp->icmp_seq) <= ( n_short )max_seq_sent ) )
{
/* this is a response to a ping we sent */
- h = table[sent_icmp->icmp_seq];
+ h = table[ntohs(sent_icmp->icmp_seq) % num_hosts];
fprintf( stderr, "%s from %s for ICMP Echo sent to %s",
icmp_type_str[p->icmp_type], inet_ntoa( addr->sin_addr ), h->host );
if( inet_addr( h->host ) == -1 )
fprintf( stderr, " (%s)", inet_ntoa( h->saddr.sin_addr ) );
#else
- if( ( sent_icmp->icmp6_type = ICMP_ECHO ) &&
- ( sent_icmp->icmp6_id = ident ) &&
- ( sent_icmp->icmp6_seq < ( n_short )num_hosts ) )
+ if( ( sent_icmp->icmp6_type == ICMP_ECHO ) &&
+ ( ntohs(sent_icmp->icmp6_id) == ident ) &&
+ ( ntohs(sent_icmp->icmp6_seq) <= ( n_short )max_seq_sent ) )
{
/* this is a response to a ping we sent */
- h = table[sent_icmp->icmp6_seq];
+ h = table[ntohs(sent_icmp->icmp6_seq) % num_hosts];
fprintf( stderr, "%s from %s for ICMP Echo sent to %s",
icmp_type_str[p->icmp6_type], addr_ascii, h->host );
@@ -2165,20 +2252,33 @@
struct addrinfo *res, hints;
int ret_ga;
char *hostname;
+ size_t len;
/* getaddrinfo */
bzero(&hints, sizeof(struct addrinfo));
- hints.ai_flags = AI_CANONNAME;
+ hints.ai_flags = name_flag ? AI_CANONNAME : 0;
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_RAW;
hints.ai_protocol = IPPROTO_ICMPV6;
ret_ga = getaddrinfo(name, NULL, &hints, &res);
- if (ret_ga) errx(1, "%s", gai_strerror(ret_ga));
+ if (ret_ga) {
+ if(!quiet_flag)
+ warnx("%s", gai_strerror(ret_ga));
+ num_noaddress++;
+ return;
+ }
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);*/
+ if (!res->ai_addr) {
+ if(!quiet_flag)
+ warnx("getaddrinfo failed");
+ num_noaddress++;
+ return;
+ }
+ 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() */
@@ -2730,9 +2830,11 @@
fprintf( stderr, " (in looping and counting modes, default %d)\n", perhost_interval / 100 );
fprintf( stderr, " -q quiet (don't show per-target/per-ping results)\n" );
fprintf( stderr, " -Q n same as -q, but show summary every n seconds\n" );
- fprintf( stderr, " -r n number of retries (default %d)\n", retry );
+ fprintf( stderr, " -r n number of retries (default %d)\n", DEFAULT_RETRY );
fprintf( stderr, " -s print final stats\n" );
+ fprintf( stderr, " -S addr set source address\n" );
fprintf( stderr, " -t n individual target initial timeout (in millisec) (default %d)\n", timeout / 100 );
+ fprintf( stderr, " -T n set select timeout (default %d)\n", select_time / 100 );
fprintf( stderr, " -u show targets that are unreachable\n" );
fprintf( stderr, " -v show version\n" );
fprintf( stderr, " targets list of targets to check (if no -f specified)\n" );
--- fping-2.4b2-to-ipv6.orig/debian/fping.docs
+++ fping-2.4b2-to-ipv6/debian/fping.docs
@@ -0,0 +1 @@
+README
--- fping-2.4b2-to-ipv6.orig/debian/lintian.overrides
+++ fping-2.4b2-to-ipv6/debian/lintian.overrides
@@ -0,0 +1 @@
+fping: setuid-binary
--- fping-2.4b2-to-ipv6.orig/debian/fping.dirs
+++ fping-2.4b2-to-ipv6/debian/fping.dirs
@@ -0,0 +1,4 @@
+usr/bin
+usr/sbin
+usr/share/man/man8
+usr/share/lintian/overrides
--- fping-2.4b2-to-ipv6.orig/debian/copyright
+++ fping-2.4b2-to-ipv6/debian/copyright
@@ -0,0 +1,33 @@
+This package was split from netstd by Herbert Xu herbert@debian.org on
+Sat, 30 Oct 1999 16:39:06 +1000.
+
+It is maintained by Anibal Monsalve Salazar <anibal@debian.org>.
+
+netstd was created by Peter Tobias tobias@et-inf.fho-emden.de on
+Wed, 20 Jul 1994 17:23:21 +0200.
+
+It was downloaded from http://www.fping.com/.
+
+Copyright:
+
+Upstream maintainer: David Papp <david@remote.net>
+Original author: Roland Schemers <schemers@stanford.edu>
+IPv6 Support: Jeroen Massar <jeroen@unfix.org / jeroen@ipng.nl>
+
+
+Copyright (c) 1992, 1994, 1997
+Board of Trustees
+Leland Stanford Jr. University
+
+Redistribution and use in source and binary forms are permitted provided
+that the above copyright notice and this paragraph are duplicated in all
+such forms and that any documentation, advertising materials, and other
+materials related to such distribution and use acknowledge that the software
+was developed by Stanford University. The name of the University may not
+be used to endorse or promote products derived from this software without
+specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
--- fping-2.4b2-to-ipv6.orig/debian/control
+++ fping-2.4b2-to-ipv6/debian/control
@@ -0,0 +1,20 @@
+Source: fping
+Section: net
+Priority: optional
+Maintainer: Anibal Monsalve Salazar <anibal@debian.org>
+Standards-Version: 3.8.0
+Build-Depends: debhelper (>= 5)
+Homepage: http://fping.sourceforge.net/
+
+Package: fping
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: suidmanager (<< 0.50)
+Replaces: netstd
+Description: sends ICMP ECHO_REQUEST packets to network hosts
+ fping is a ping like program which uses the Internet Control Message Protocol
+ (ICMP) echo request to determine if a target host is responding. fping
+ differs from ping in that you can specify any number of targets on the command
+ line, or specify a file containing the lists of targets to ping. Instead of
+ sending to one target until it times out or replies, fping will send out a
+ ping packet and move on to the next target in a round-robin fashion.
--- fping-2.4b2-to-ipv6.orig/debian/rules
+++ fping-2.4b2-to-ipv6/debian/rules
@@ -0,0 +1,78 @@
+#!/usr/bin/make -f
+# GNU copyright 1997 to 1999 by Joey Hess.
+# Copyright (c) 1999 Herbert Xu <herbert@debian.org>
+# Copyright (c) 2004-2005 Anibal Monsalve Salazar <anibal@debian.org>
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+
+ mkdir build build/ipv4 build/ipv6
+ cp -a $$(find * -maxdepth 0 ! -name build) build
+ cd build/ipv4; ../configure
+ cd build/ipv6; ../configure
+
+ touch configure-stamp
+
+build: build-stamp
+build-stamp: configure-stamp
+ dh_testdir
+
+ $(MAKE) -C build/ipv4
+ $(MAKE) -C build/ipv6 CFLAGS='-g -O2 -DIPV6=1'
+
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+
+ rm -rf build build-stamp configure-stamp
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ install build/ipv4/fping debian/fping/usr/bin
+ install build/ipv6/fping debian/fping/usr/bin/fping6
+ cp fping.8 debian/fping/usr/share/man/man8
+ ln -s fping.8 debian/fping/usr/share/man/man8/fping6.8
+
+ install -g 0 -o 0 -m 644 -p debian/lintian.overrides debian/fping/usr/share/lintian/overrides/fping
+
+ touch install-stamp
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installdocs
+ dh_installexamples
+ dh_installmenu
+ dh_installcron
+ dh_installinfo
+ dh_installchangelogs ChangeLog
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+ chmod 4755 debian/fping/usr/bin/fping*
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean configure binary-indep binary-arch binary install
--- fping-2.4b2-to-ipv6.orig/debian/compat
+++ fping-2.4b2-to-ipv6/debian/compat
@@ -0,0 +1 @@
+5
--- fping-2.4b2-to-ipv6.orig/debian/changelog
+++ fping-2.4b2-to-ipv6/debian/changelog
@@ -0,0 +1,174 @@
+fping (2.4b2-to-ipv6-16.1) unstable; urgency=low
+
+ * NMU during Moenchengladbach BSP
+ * Fixes FTBFS on kfreebsd (Closes: #555398)
+ * Fixes typo "Paramter" in binary
+
+ -- Axel Beckert <abe@deuxchevaux.org> Sat, 23 Jan 2010 16:22:02 +0100
+
+fping (2.4b2-to-ipv6-16) unstable; urgency=low
+
+ * Fix the following bugs
+ - Network byte order sensitivity was missing completely.
+ Added hopefully all missing calls.
+ - The sequence numbering scheme used led to packet drops.
+ Changed it to a more senseful numbering scheme.
+ - Some minor C programming mistakes ('=' instead of '==').
+ Patch by Stephan Fuhrmann; closes: #502569
+ * Add support for command line select timeout setting
+ Patch by Marton Balint; closes: #502575
+ * Remove symlinks in /usr/sbin; closes: #377732
+ * Standards-Version is 3.8.0
+
+ -- Anibal Monsalve Salazar <anibal@debian.org> Sat, 18 Oct 2008 12:04:52 +1100
+
+fping (2.4b2-to-ipv6-15) unstable; urgency=low
+
+ * Added interface binding (-I) for fping
+ Patch by Peter Naulls <peter@mushroomnetworks.com>
+ Closes: #439014
+ * Fixed a couple of typos in fping.8. Closes: #423180
+ * Added homepage control header
+ * Bumped Standards-Version to 3.7.3
+ * Fixed the following lintian issue:
+ - debian-rules-sets-DH_COMPAT
+
+ -- Anibal Monsalve Salazar <anibal@debian.org> Mon, 03 Mar 2008 17:46:17 +1100
+
+fping (2.4b2-to-ipv6-14) unstable; urgency=low
+
+ * Set Standards-Version to 3.7.2.
+ * Set DH_COMPAT to 5.
+
+ -- Anibal Monsalve Salazar <anibal@debian.org> Fri, 23 Jun 2006 20:56:39 +1000
+
+fping (2.4b2-to-ipv6-13) unstable; urgency=low
+
+ * Fixed stdout flush problem, closes: #340146.
+ Patch by Bart Martens <bart.martens@advalvas.be>.
+
+ -- Anibal Monsalve Salazar <anibal@debian.org> Fri, 30 Dec 2005 08:30:09 +1100
+
+fping (2.4b2-to-ipv6-12) unstable; urgency=low
+
+ * Fixed "problem with option -r (retry limit)", closes: #318402.
+ Patch by Qingning Huo <qingningh@lanware.co.uk>.
+ * Set Standards-Version to 3.6.2 in debian/control and DH_COMPAT
+ to 4 in debian/rules..
+
+ -- Anibal Monsalve Salazar <anibal@debian.org> Sat, 08 Oct 2005 21:26:35 +1000
+
+fping (2.4b2-to-ipv6-11) unstable; urgency=low
+
+ * Fixed "would be useful to specify 'source address' like ping for multi
+ homed machines", closes: #198486.
+ Patch by Marc Haber <mh+debian-bugs@zugschlus.de>.
+
+ -- Anibal Monsalve Salazar <anibal@debian.org> Thu, 02 Jun 2005 08:14:54 +1000
+
+fping (2.4b2-to-ipv6-10) unstable; urgency=low
+
+ * Fixed "unnecessary delay with the -c option after the last packet"
+ (Closes: #293856). Patch by Niko Tyni <ntyni@iki.fi>
+ * New maintainer's email address.
+
+ -- Anibal Monsalve Salazar <anibal@debian.org> Sun, 06 Feb 2005 23:25:57 +1100
+
+fping (2.4b2-to-ipv6-9) unstable; urgency=low
+
+ * Fixed "fping6 always does reverse lookup" (Closes: #273647).
+ Patch by Jeroen Massar and forwarded by Bernhard Schmidt <berni@birkenwald.de>
+
+ -- Anibal Monsalve Salazar <A.Monsalve.Salazar@IEEE.org> Mon, 10 Jan 2005 00:01:32 +1100
+
+fping (2.4b2-to-ipv6-8) unstable; urgency=low
+
+ * New maintainer.
+
+ -- Anibal Monsalve Salazar <A.Monsalve.Salazar@IEEE.org> Thu, 20 May 2004 09:42:08 +1000
+
+fping (2.4b2-to-ipv6-7) unstable; urgency=low
+
+ * Build fping in build/ipv[46] instead of build and build-ipv6.
+ * Made DNS errors non-fatal for IPv6 (closes: #198056).
+
+ -- Herbert Xu <herbert@debian.org> Fri, 20 Jun 2003 21:36:30 +1000
+
+fping (2.4b2-to-ipv6-6) unstable; urgency=low
+
+ * Do not use incorrect linux.h file (closes: #85468).
+
+ -- Herbert Xu <herbert@debian.org> Sat, 17 May 2003 14:13:11 +1000
+
+fping (2.4b2-to-ipv6-5) unstable; urgency=low
+
+ * Fixed yet another divide by zero bug (closes: #148445).
+
+ -- Herbert Xu <herbert@debian.org> Tue, 4 Jun 2002 12:18:03 +1000
+
+fping (2.4b2-to-ipv6-4) unstable; urgency=low
+
+ * Made fping6 setuid (closes: #136386).
+ * Moved fping back into bin.
+ * Partially applied IPv6 patch to fix IPv6 checksums (closes: #136479).
+
+ -- Herbert Xu <herbert@debian.org> Sun, 7 Apr 2002 20:36:56 +1000
+
+fping (2.4b2-to-ipv6-3) unstable; urgency=low
+
+ * Added compatibility symlink for fping (closes: #135203).
+
+ -- Herbert Xu <herbert@debian.org> Sat, 23 Feb 2002 08:34:11 +1100
+
+fping (2.4b2-to-ipv6-2) unstable; urgency=low
+
+ * Turned setuid bit on again since the code before dropping privilegs is
+ minimal.
+ * Fixed another divide by zero error (closes: #132370).
+
+ -- Herbert Xu <herbert@debian.org> Thu, 7 Feb 2002 20:10:48 +1100
+
+fping (2.4b2-to-ipv6-1) unstable; urgency=low
+
+ * New upstream release.
+ * Install fping into sbin as done by upstream.
+ * Turned setuid bit off.
+
+ -- Herbert Xu <herbert@debian.org> Fri, 1 Feb 2002 22:11:59 +1100
+
+fping (2.2b2-3) unstable; urgency=low
+
+ * Removed INSTALL file from package (closes: #84050).
+ * Fixed alignment bug.
+
+ -- Herbert Xu <herbert@debian.org> Sat, 10 Feb 2001 19:25:18 +1100
+
+fping (2.2b2-2) unstable; urgency=low
+
+ * Made changes for dpkg-statoverride (closes: #83838).
+
+ -- Herbert Xu <herbert@debian.org> Sun, 28 Jan 2001 21:53:05 +1100
+
+fping (2.2b2-1) unstable; urgency=low
+
+ * New upstream release.
+ * Fixed typo that prevented -d from working (closes: #83255).
+ * Drop root privileges after opening the socket (closes: #81589).
+ * Fixed the options [tip], they were out by a factor of 10
+ (Richard Kettlewell, closes: #83742).
+
+ -- Herbert Xu <herbert@debian.org> Sun, 28 Jan 2001 00:09:41 +1100
+
+fping (2.2b1-2) unstable; urgency=low
+
+ * Fixed typo in control file, spotted by William Ono (closes: #49909).
+
+ -- Herbert Xu <herbert@debian.org> Mon, 15 May 2000 12:27:03 +1000
+
+fping (2.2b1-1) unstable; urgency=low
+
+ * Initial release.
+ * Fixed divide by zero error (closes: #29902).
+
+ -- Herbert Xu <herbert@debian.org> Sat, 30 Oct 1999 16:36:19 +1000
+
|