From af4bed9262b10316067b7528cab888623cddf52f Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 6 Apr 2018 08:29:30 +0200 Subject: [PATCH] don't respond to NTPv0 packets --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index dcf2508..892bcd3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -136,7 +136,7 @@ impl NtpPacket { let version = (buf[0] >> 3) & 0x7; let mode = buf[0] & 0x7; - if version > 4 { + if version < 1 || version > 4 { return Err(Error::new(ErrorKind::Other, "Unsupported version")); }