Fix -q not suppressing some ICMP error messages, fixes #83

version3
David Schweikert 8 years ago
parent 099d873253
commit 926c104e90

@ -1,5 +1,6 @@
Unreleased Unreleased
* (bugfix) Fix compatibility issue with AIX (#69, @blentzgh) * (bugfix) Fix compatibility issue with AIX (#69, @blentzgh)
* (bugfix) Fix -q not suppressing some ICMP error messages (#83)
2017-01-11 David Schweikert <david@schweikert.ch> 2017-01-11 David Schweikert <david@schweikert.ch>
* Version 3.15 * Version 3.15

@ -1907,18 +1907,18 @@ int handle_random_icmp(FPING_ICMPHDR *p, struct sockaddr *addr, socklen_t addr_l
/* this is a response to a ping we sent */ /* this is a response to a ping we sent */
h = table[ntohs(sent_icmp_seq) % num_hosts]; h = table[ntohs(sent_icmp_seq) % num_hosts];
if(icmp_type <= ICMP_TYPE_STR_MAX) { if(icmp_type <= ICMP_TYPE_STR_MAX) {
fprintf( stderr, "%s from %s for ICMP Echo sent to %s", print_warning("%s from %s for ICMP Echo sent to %s",
icmp_type_str[icmp_type], addr_ascii, h->host ); icmp_type_str[icmp_type], addr_ascii, h->host );
} }
else { else {
fprintf( stderr, "ICMP %d from %s for ICMP Echo sent to %s", print_warning("ICMP %d from %s for ICMP Echo sent to %s",
icmp_type, addr_ascii, h->host ); icmp_type, addr_ascii, h->host );
} }
if( inet_addr( h->host ) == INADDR_NONE ) if( inet_addr( h->host ) == INADDR_NONE )
fprintf( stderr, " (%s)", addr_ascii ); print_warning(" (%s)", addr_ascii );
fprintf( stderr, "\n" ); print_warning( "\n" );
}/* IF */ }/* IF */

Loading…
Cancel
Save