[monitoring-plugins] make use of MSG_CONFIRM optional

Sven Nierlein git at monitoring-plugins.org
Thu Jan 29 17:20:09 CET 2015


 Module: monitoring-plugins
 Branch: master
 Commit: 809508926f0739b5f289f688ef1fe1b0b1e38e86
 Author: Sven Nierlein <Sven.Nierlein at consol.de>
   Date: Thu Jan 29 16:18:27 2015 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=8095089

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)

---

 plugins-root/check_icmp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index 3982def..f420837 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)
 	hdr.msg_iov = &iov;
 	hdr.msg_iovlen = 1;
 
+/* MSG_CONFIRM is a linux thing and only available on linux kernels >= 2.3.15, see send(2) */
+#ifdef MSG_CONFIRM
 	len = sendmsg(sock, &hdr, MSG_CONFIRM);
+#else
+	len = sendmsg(sock, &hdr, 0);
+#endif
 
 	if(len < 0 || (unsigned int)len != icmp_pkt_size) {
 		if(debug) printf("Failed to send ping to %s\n",



More information about the Commits mailing list