Don't output ICMP errors with -q option (#1)

pull/19/head
Andreas Jaggi 13 years ago
parent 063ee44417
commit 8e57b6f43f

@ -1901,6 +1901,7 @@ int handle_random_icmp( FPING_ICMPHDR *p, int psize, FPING_SOCKADDR *addr )
#endif #endif
{ {
case ICMP_UNREACH: case ICMP_UNREACH:
if( !quiet_flag ) {
sent_icmp = ( FPING_ICMPHDR* )( c + 28 ); sent_icmp = ( FPING_ICMPHDR* )( c + 28 );
#ifndef IPV6 #ifndef IPV6
@ -1953,6 +1954,7 @@ int handle_random_icmp( FPING_ICMPHDR *p, int psize, FPING_SOCKADDR *addr )
fprintf( stderr, "\n" ); fprintf( stderr, "\n" );
}/* IF */ }/* IF */
}/* IF */
return 1; return 1;
@ -1960,6 +1962,7 @@ int handle_random_icmp( FPING_ICMPHDR *p, int psize, FPING_SOCKADDR *addr )
case ICMP_REDIRECT: case ICMP_REDIRECT:
case ICMP_TIMXCEED: case ICMP_TIMXCEED:
case ICMP_PARAMPROB: case ICMP_PARAMPROB:
if( !quiet_flag ) {
sent_icmp = ( FPING_ICMPHDR* )( c + 28 ); sent_icmp = ( FPING_ICMPHDR* )( c + 28 );
#ifndef IPV6 #ifndef IPV6
if( ( sent_icmp->icmp_type == ICMP_ECHO ) && if( ( sent_icmp->icmp_type == ICMP_ECHO ) &&
@ -1990,6 +1993,7 @@ int handle_random_icmp( FPING_ICMPHDR *p, int psize, FPING_SOCKADDR *addr )
fprintf( stderr, "\n" ); fprintf( stderr, "\n" );
}/* IF */ }/* IF */
}/* IF */
return 2; return 2;

Loading…
Cancel
Save