don't respond to NTPv0 packets
This commit is contained in:
parent
2b2e2e7623
commit
af4bed9262
@ -136,7 +136,7 @@ impl NtpPacket {
|
|||||||
let version = (buf[0] >> 3) & 0x7;
|
let version = (buf[0] >> 3) & 0x7;
|
||||||
let mode = buf[0] & 0x7;
|
let mode = buf[0] & 0x7;
|
||||||
|
|
||||||
if version > 4 {
|
if version < 1 || version > 4 {
|
||||||
return Err(Error::new(ErrorKind::Other, "Unsupported version"));
|
return Err(Error::new(ErrorKind::Other, "Unsupported version"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user