[Nagiosplug-devel] bug fixes for nagios plugins

Janos Mohacsi mohacsi at niif.hu
Fri Jun 27 06:40:04 CEST 2003

Dear All,
	I tried the nagios-plugins-200306262230 snapshot on a FreeBSD, and
I found two bugs:

1. The uintmax_t type is only defined the FreeBSD 5.x series. If you want
to install on a FreeBSD 4.x you have to define yourself the uintmax_t
type.  See the attached unified diff for fsusage.h.diff. It has been
tested on FreeBSD 4.x and 5.x. It seems to be a hack....

2. The IPv6 support in the plugins was broken. The hint structure
initialisation did not follow the standard (RFC3493). I made the unified
diff to fix the problem (see netutils.c.diff). I has been tested on
FreeBSD 4.x and 5.x.

I hope the patches above will be somehow integrated into the CVS and later
in the new version of the plugins.

Kindest Regards,

Janos Mohacsi
Network Engineer, Research Associate
Key 00F9AF98: 8645 1312 D249 471B DBAE  21A2 9F52 0D1F 00F9 AF98
-------------- next part --------------
--- fsusage.h.orig	Fri Jun 27 14:31:10 2003
+++ fsusage.h	Fri Jun 27 14:31:36 2003
@@ -20,6 +20,10 @@
 #if !defined FSUSAGE_H_
 # define FSUSAGE_H_
+#if !defined uintmax_t
+typedef  u_int64_t uintmax_t;
 struct fs_usage
   int fsu_blocksize;		/* Size of a block.  */
-------------- next part --------------
--- netutils.c.orig	Fri Jun 27 14:32:52 2003
+++ netutils.c	Fri Jun 27 14:34:35 2003
@@ -255,7 +255,8 @@
 	memset (&hints, 0, sizeof (hints));
 	hints.ai_family = PF_UNSPEC;
-	hints.ai_protocol = proto;
+	hints.ai_socktype = (proto == IPPROTO_UDP) ?  SOCK_DGRAM : SOCK_STREAM;
+	/*hints.ai_protocol = proto;*/
 	snprintf (port_str, sizeof (port_str), "%d", port);
 	result = getaddrinfo (host_name, port_str, &hints, &res);

More information about the Devel mailing list