[PATCH 5/9] ntp: Support NTPv3 protocol version

Peter Meerwald pmeerw at pmeerw.net
Tue Sep 10 06:46:16 PDT 2013


NTPv3 is advertised by Windows 7, but only v4 is accepted

rc/ntp.c:send_timeout() send timeout (retries 1)
src/ntp.c:decode_msg() flags : 0x1c
src/ntp.c:decode_msg() stratum : 1
src/ntp.c:decode_msg() poll : 1024.000000 seconds (10)
src/ntp.c:decode_msg() precision : 0.015625 seconds (-6)
src/ntp.c:decode_msg() root delay : 0 seconds (fraction 0)
src/ntp.c:decode_msg() root disp. : 2560 seconds (fraction 19716)
src/ntp.c:decode_msg() reference : 0x4c434f4c
src/ntp.c:decode_msg() unsupported version 3
connmand[21770]: src/ntp.c:decode_msg() flags : 0x1c
connmand[21770]: src/ntp.c:decode_msg() stratum : 1
connmand[21770]: src/ntp.c:decode_msg() poll : 1024.000000 seconds (10)
connmand[21770]: src/ntp.c:decode_msg() precision : 0.015625 seconds (-6)
connmand[21770]: src/ntp.c:decode_msg() root delay : 0 seconds (fraction 0)
connmand[21770]: src/ntp.c:decode_msg() root disp. : 2560 seconds (fraction 19716)
connmand[21770]: src/ntp.c:decode_msg() reference : 0x4c434f4c
connmand[21770]: src/ntp.c:decode_msg() unsupported version 3

enable v3 also
---
 src/ntp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ntp.c b/src/ntp.c
index 6db9af7..a1013e1 100644
--- a/src/ntp.c
+++ b/src/ntp.c
@@ -253,7 +253,7 @@ static void decode_msg(void *base, size_t len, struct timeval *tv,
 		return;
 	}
 
-	if (NTP_FLAGS_VN_DECODE(msg->flags) != 4) {
+	if (NTP_FLAGS_VN_DECODE(msg->flags) != 3 && NTP_FLAGS_VN_DECODE(msg->flags) != 4) {
 		DBG("unsupported version %d", NTP_FLAGS_VN_DECODE(msg->flags));
 		return;
 	}
-- 
1.7.9.5




More information about the connman mailing list