summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2006-04-07 19:41:41 +0000
committerStef Walter <stef@memberwebs.com>2006-04-07 19:41:41 +0000
commit752659a01453b0e6ce0558169bbe0833544361fd (patch)
treeacd6f481fa5f9e6e0d39ea4f989a7b0c71252edf /module
parent8cbb9b9104a4e86b51067666e48fc5e4346cfb68 (diff)
Don't print error messages on common ping failure conditions.
Diffstat (limited to 'module')
-rw-r--r--module/bsnmp-ping.c15
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++;