Fix datagram parsing

This commit is contained in:
Anton Zadvorny 2021-07-10 11:50:31 +03:00
parent 17ecf10f79
commit ffe6ac7161

View File

@ -30,7 +30,7 @@ func NewDatagramFrom(r io.Reader) (*Datagram, error) {
return nil, err
}
if !bytes.Equal([]byte{Reserved, Reserved}, buf[:1]) {
if !bytes.Equal([]byte{Reserved, Reserved}, buf[:2]) {
return nil, ErrBadDatagram
}