Преглед изворни кода

Fix newly added stratum check (has to be decreased by one when using normal NTP packets versus control packets)

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1822 f882894a-f735-0410-b71e-b25c423dba1c
Thomas Guyot-Sionnest пре 18 година
родитељ
комит
b24243c2d9
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      plugins/check_ntp.c

+ 3 - 1
plugins/check_ntp.c

@@ -487,7 +487,9 @@ double offset_request(const char *host, int *stratum, int *status){
 			avg_offset+=servers[best_index].offset[j];
 		}
 		avg_offset/=servers[best_index].num_responses;
-		*stratum = servers[best_index].stratum;
+		/* Stratum sent in normal packets is ingreased by 1 (i.e. stratum that
+		 * would be displayed if we were a server) so we decrease it */
+		*stratum = servers[best_index].stratum - 1;
 	}
 
 	/* cleanup */