[Nagiosplug-devel] [Nagiosplug-checkins] nagiosplug/plugins check_ntp.c, 1.21, 1.22

Andreas Ericsson ae at op5.se
Tue Apr 3 12:03:48 CEST 2007


Thomas Guyot wrote:
> Update of /cvsroot/nagiosplug/nagiosplug/plugins
> In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18344/plugins
> 
> Modified Files:
> 	check_ntp.c 
> Log Message:
> Temporary fix for jitter calculation
> 
> 
> Index: check_ntp.c
> ===================================================================
> RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ntp.c,v
> retrieving revision 1.21
> retrieving revision 1.22
> diff -u -d -r1.21 -r1.22
> --- check_ntp.c	2 Apr 2007 12:39:30 -0000	1.21
> +++ check_ntp.c	3 Apr 2007 01:31:25 -0000	1.22
> @@ -475,7 +475,10 @@
>  	}
>  
>  	/* cleanup */
> -	for(j=0; j<num_hosts; j++){ close(socklist[j]); }
> +	/* FIXME: Not closing the socket to avoid re-use of the local port
> +	 * which can cause old NTP packets to be read instead of NTP control
> +	 * pactets in jitter_request(). THERE MUST BE ANOTHER WAY...
> +	 * for(j=0; j<num_hosts; j++){ close(socklist[j]); } */


int yes = 1;
sock = socket(blahblah, yadayada, foobar);
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int));

slap on some error checking etc. I'll send in a patch once the git cvsimport
script is done running.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231




More information about the Devel mailing list