int myseq;
int ret = 1;
- memset( ping_buffer, 0, ping_pkt_size * sizeof( char ) );
- buffer = ( char* )malloc( ( size_t )ping_pkt_size );
- if( !buffer )
- crash_and_burn( "can't malloc ping packet" );
-
+ if (random_data_flag) {
+ for (n = 0; n < ping_pkt_size; ++n) {
- buffer[n] = random() & 0xFF;
++ ping_buffer[n] = random() & 0xFF;
+ }
+ } else {
- memset( buffer, 0, ping_pkt_size * sizeof( char ) );
++ memset( ping_buffer, 0, ping_pkt_size * sizeof( char ) );
+ }
- icp = ( FPING_ICMPHDR* )buffer;
+ icp = ( FPING_ICMPHDR* )ping_buffer;
gettimeofday( &h->last_send_time, &tz );
myseq = seqmap_add(h->i, h->num_sent, &h->last_send_time);