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

Holger Weiss hweiss at users.sourceforge.net
Tue Apr 3 19:19:07 CEST 2007


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv1513

Modified Files:
	check_ntp.c 
Log Message:
Fix the synchronization source selection on big-endian systems.


Index: check_ntp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ntp.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- check_ntp.c	3 Apr 2007 01:31:25 -0000	1.22
+++ check_ntp.c	3 Apr 2007 17:19:04 -0000	1.23
@@ -138,8 +138,8 @@
 #define OP_SET(x,y)   do{ x |= (y&OP_MASK); }while(0)
 #define OP_READSTAT 0x01
 #define OP_READVAR  0x02
-/* In peer status bytes, bytes 6,7,8 determine clock selection status */
-#define PEER_SEL(x) (x&0x07)
+/* In peer status bytes, bits 6,7,8 determine clock selection status */
+#define PEER_SEL(x) ((ntohs(x)>>8)&0x07)
 #define PEER_INCLUDED 0x04
 #define PEER_SYNCSOURCE 0x06
 





More information about the Commits mailing list