@@ -317,6 +317,7 @@ unsigned int debugging = 0;
317317/* all time-related values are int64_t nanoseconds */
318318unsigned int retry = DEFAULT_RETRY ;
319319int64_t timeout = (int64_t )DEFAULT_TIMEOUT * 1000000 ;
320+ int64_t seqmap_timeout = (int64_t )DEFAULT_SEQMAP_TIMEOUT * 1000000 ;
320321int64_t interval = (int64_t )DEFAULT_INTERVAL * 1000000 ;
321322int64_t perhost_interval = (int64_t )DEFAULT_PERHOST_INTERVAL * 1000000 ;
322323float backoff = DEFAULT_BACKOFF_FACTOR ;
@@ -578,6 +579,7 @@ int main(int argc, char **argv)
578579 { "check-source" , '0' , OPTPARSE_NONE },
579580 { "print-tos" , '0' , OPTPARSE_NONE },
580581 { "print-ttl" , '0' , OPTPARSE_NONE },
582+ { "seqmap-timeout" , '0' , OPTPARSE_REQUIRED },
581583#if defined(DEBUG ) || defined (_DEBUG )
582584 { NULL , 'z' , OPTPARSE_REQUIRED },
583585#endif
@@ -638,6 +640,12 @@ int main(int argc, char **argv)
638640 }
639641 }
640642#endif
643+ } else if (strstr (optparse_state .optlongname , "seqmap-timeout" ) != NULL ) {
644+ if (sscanf (optparse_state .optarg , "%f" , & opt_value_float ) != 1 )
645+ usage (1 );
646+ if (opt_value_float < 0 )
647+ usage (1 );
648+ seqmap_timeout = opt_value_float * 1000000 ;
641649 } else {
642650 usage (1 );
643651 }
@@ -1077,6 +1085,7 @@ int main(int argc, char **argv)
10771085 prog , count , retry , interval / 1e6 );
10781086 fprintf (stderr , " perhost_interval: %.0f ms, timeout: %.0f\n" ,
10791087 perhost_interval / 1e6 , timeout / 1e6 );
1088+ fprintf (stderr , " seqmap_timeout: %.0f\n" , seqmap_timeout / 1e6 );
10801089 fprintf (stderr , " ping_data_size = %u, trials = %u\n" ,
10811090 ping_data_size , trials );
10821091
@@ -1355,7 +1364,7 @@ int main(int argc, char **argv)
13551364
13561365 last_send_time = 0 ;
13571366
1358- seqmap_init ();
1367+ seqmap_init (seqmap_timeout );
13591368
13601369 /* main loop */
13611370 main_loop ();
@@ -3446,6 +3455,7 @@ void usage(int is_error)
34463455 fprintf (out , " -r, --retry=N number of retries (default: %d)\n" , DEFAULT_RETRY );
34473456 fprintf (out , " -R, --random random packet data (to foil link data compression)\n" );
34483457 fprintf (out , " -S, --src=IP set source address\n" );
3458+ fprintf (out , " --seqmap-timeout=MSEC sequence number mapping timeout (default: %.0f ms)\n" , seqmap_timeout / 1e6 );
34493459 fprintf (out , " -t, --timeout=MSEC individual target initial timeout (default: %.0f ms,\n" , timeout / 1e6 );
34503460 fprintf (out , " except with -l/-c/-C, where it's the -p period up to 2000 ms)\n" );
34513461 fprintf (out , " --check-source discard replies not from target address\n" );
0 commit comments