[Nagiosplug-devel] bug fixes for nagios plugins

Jeremy T. Bouse jeremy+nagios at undergrid.net
Fri Jun 27 11:42:04 CEST 2003


	Thank you for finding that issue with regards to netutils.c
initialization of the socket structure... I'll go ahead and get that
change made as I've been working on the AF-independent code
primarially... The intent was to follow RFC3493 following code
modification recommendations by Itojun from the IPv6 working groups...

	Regards,
	Jeremy 

On Fri, Jun 27, 2003 at 03:31:49PM +0200, Janos Mohacsi wrote:
> 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
> NIIF/HUNGARNET, HUNGARY
> Key 00F9AF98: 8645 1312 D249 471B DBAE  21A2 9F52 0D1F 00F9 AF98
> --- 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;
> +#endif
> +
>  struct fs_usage
>  {
>    int fsu_blocksize;		/* Size of a block.  */

> --- 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