summaryrefslogtreecommitdiffstats
path: root/plugins-root
diff options
context:
space:
mode:
authorSven Nierlein <Sven.Nierlein@consol.de>2015-01-29 16:18:27 +0100
committerSven Nierlein <Sven.Nierlein@consol.de>2015-01-29 16:18:27 +0100
commit809508926f0739b5f289f688ef1fe1b0b1e38e86 (patch)
tree6088cb8b593e6fb4055f0cd1fc435d6d95552eba /plugins-root
parent0a236c7c70a5d3b9f921338fca8ea67196a05c12 (diff)
downloadmonitoring-plugins-809508926f0739b5f289f688ef1fe1b0b1e38e86.tar.gz
make use of MSG_CONFIRM optional
since MSG_CONFIRM is a linux thing and only available on linux kernels >= 2.3.15, see send(2)
Diffstat (limited to 'plugins-root')
-rw-r--r--plugins-root/check_icmp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index 3982def9..f4208371 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -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",