|
|
473877 |
diff -up ntp-4.2.6p4/ntpstat-0.2/ntpstat.c.errorbit ntp-4.2.6p4/ntpstat-0.2/ntpstat.c
|
|
|
473877 |
--- ntp-4.2.6p4/ntpstat-0.2/ntpstat.c.errorbit 2011-10-06 13:41:38.591669772 +0200
|
|
|
473877 |
+++ ntp-4.2.6p4/ntpstat-0.2/ntpstat.c 2011-10-06 16:50:01.708315811 +0200
|
|
|
473877 |
@@ -104,6 +104,7 @@ int main (void) {
|
|
|
473877 |
FD_ZERO(&fds);
|
|
|
473877 |
|
|
|
473877 |
inet_aton("127.0.0.1", &address);
|
|
|
473877 |
+ memset(&sock, 0, sizeof (sock));;
|
|
|
473877 |
sock.sin_family = AF_INET;
|
|
|
473877 |
sock.sin_addr = address;
|
|
|
473877 |
sock.sin_port = htons(NTP_PORT);
|
|
|
473877 |
@@ -159,15 +160,18 @@ int main (void) {
|
|
|
473877 |
die ("return data appears to be invalid based on status word");
|
|
|
473877 |
}
|
|
|
473877 |
|
|
|
473877 |
- if (!(ntpmsg.byte2 | EMASK)) {
|
|
|
473877 |
+ if (ntpmsg.byte2 & EMASK) {
|
|
|
473877 |
fprintf (stderr,"status byte2 is %02x\n", ntpmsg.byte2 );
|
|
|
473877 |
die ("error bit is set in reply");
|
|
|
473877 |
}
|
|
|
473877 |
|
|
|
473877 |
- if (!(ntpmsg.byte2 | MMASK)) {
|
|
|
473877 |
+ /* ignore the more bit */
|
|
|
473877 |
+#if 0
|
|
|
473877 |
+ if (ntpmsg.byte2 & MMASK) {
|
|
|
473877 |
fprintf (stderr,"status byte2 is %02x\n", ntpmsg.byte2 );
|
|
|
473877 |
fprintf (stderr,"More bit unexpected in reply");
|
|
|
473877 |
}
|
|
|
473877 |
+#endif
|
|
|
473877 |
|
|
|
473877 |
/* if the leap indicator (LI), which is the two most significant bits
|
|
|
473877 |
in status byte1, are both one, then the clock is not synchronised. */
|