diff options
Diffstat (limited to 'module')
-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++; |