diff options
author | Stef Walter <stef@memberwebs.com> | 2006-04-07 19:41:41 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-04-07 19:41:41 +0000 |
commit | 752659a01453b0e6ce0558169bbe0833544361fd (patch) | |
tree | acd6f481fa5f9e6e0d39ea4f989a7b0c71252edf | |
parent | 8cbb9b9104a4e86b51067666e48fc5e4346cfb68 (diff) |
Don't print error messages on common ping failure conditions.
-rw-r--r-- | module/bsnmp-ping.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/module/bsnmp-ping.c b/module/bsnmp-ping.c index 012db5c..7f2efcf 100644 --- a/module/bsnmp-ping.c +++ b/module/bsnmp-ping.c @@ -349,9 +349,18 @@ ping_fire (void *user_data) i = sendto(icmp_sock, icmp_packet, cc, 0, (struct sockaddr*)&(ping->addr), sizeof (ping->addr)); - if (i < 0) - emsg ("couldn't send ICMP packet to: %s: %s", ping->host, strerror (errno)); - else if (i != cc) + if (i < 0) { + switch (errno) { + case EHOSTDOWN: + case EHOSTUNREACH: + case ENETDOWN: + case ENETUNREACH: + break; + default: + emsg ("couldn't send ICMP packet to: %s: %s", ping->host, strerror (errno)); + break; + } + } else if (i != cc) emsg ("partial write sending ICMP packet to: %", ping->host); ping->transmitted++; |