]>
Commit | Line | Data |
---|---|---|
5af29fb3 MT |
1 | diff -up ntp-4.2.6p4/ntpstat-0.2/ntpstat.c.errorbit ntp-4.2.6p4/ntpstat-0.2/ntpstat.c |
2 | --- ntp-4.2.6p4/ntpstat-0.2/ntpstat.c.errorbit 2011-10-06 13:41:38.591669772 +0200 | |
3 | +++ ntp-4.2.6p4/ntpstat-0.2/ntpstat.c 2011-10-06 16:50:01.708315811 +0200 | |
4 | @@ -104,6 +104,7 @@ int main (void) { | |
5 | FD_ZERO(&fds); | |
6 | ||
7 | inet_aton("127.0.0.1", &address); | |
8 | + memset(&sock, 0, sizeof (sock));; | |
9 | sock.sin_family = AF_INET; | |
10 | sock.sin_addr = address; | |
11 | sock.sin_port = htons(NTP_PORT); | |
12 | @@ -159,15 +160,18 @@ int main (void) { | |
13 | die ("return data appears to be invalid based on status word"); | |
14 | } | |
15 | ||
16 | - if (!(ntpmsg.byte2 | EMASK)) { | |
17 | + if (ntpmsg.byte2 & EMASK) { | |
18 | fprintf (stderr,"status byte2 is %02x\n", ntpmsg.byte2 ); | |
19 | die ("error bit is set in reply"); | |
20 | } | |
21 | ||
22 | - if (!(ntpmsg.byte2 | MMASK)) { | |
23 | + /* ignore the more bit */ | |
24 | +#if 0 | |
25 | + if (ntpmsg.byte2 & MMASK) { | |
26 | fprintf (stderr,"status byte2 is %02x\n", ntpmsg.byte2 ); | |
27 | fprintf (stderr,"More bit unexpected in reply"); | |
28 | } | |
29 | +#endif | |
30 | ||
31 | /* if the leap indicator (LI), which is the two most significant bits | |
32 | in status byte1, are both one, then the clock is not synchronised. */ |