diff options
Diffstat (limited to 'plugins-root/check_icmp.c')
-rw-r--r-- | plugins-root/check_icmp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 3982def..9ed12ba 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c | |||
@@ -526,10 +526,10 @@ main(int argc, char **argv) | |||
526 | break; | 526 | break; |
527 | case 'V': /* version */ | 527 | case 'V': /* version */ |
528 | print_revision (progname, NP_VERSION); | 528 | print_revision (progname, NP_VERSION); |
529 | exit (STATE_OK); | 529 | exit (STATE_UNKNOWN); |
530 | case 'h': /* help */ | 530 | case 'h': /* help */ |
531 | print_help (); | 531 | print_help (); |
532 | exit (STATE_OK); | 532 | exit (STATE_UNKNOWN); |
533 | } | 533 | } |
534 | } | 534 | } |
535 | } | 535 | } |
@@ -880,7 +880,12 @@ send_icmp_ping(int sock, struct rta_host *host) | |||
880 | hdr.msg_iov = &iov; | 880 | hdr.msg_iov = &iov; |
881 | hdr.msg_iovlen = 1; | 881 | hdr.msg_iovlen = 1; |
882 | 882 | ||
883 | /* MSG_CONFIRM is a linux thing and only available on linux kernels >= 2.3.15, see send(2) */ | ||
884 | #ifdef MSG_CONFIRM | ||
883 | len = sendmsg(sock, &hdr, MSG_CONFIRM); | 885 | len = sendmsg(sock, &hdr, MSG_CONFIRM); |
886 | #else | ||
887 | len = sendmsg(sock, &hdr, 0); | ||
888 | #endif | ||
884 | 889 | ||
885 | if(len < 0 || (unsigned int)len != icmp_pkt_size) { | 890 | if(len < 0 || (unsigned int)len != icmp_pkt_size) { |
886 | if(debug) printf("Failed to send ping to %s\n", | 891 | if(debug) printf("Failed to send ping to %s\n", |