parse IETF headers independent of the sender's perspective

The IETF header format allows parsing of the header without knowing
which peer sent the packet.
This commit is contained in:
Marten Seemann 2018-05-05 17:59:54 +09:00
parent 70f6e3651e
commit 8f2fed1b10
9 changed files with 74 additions and 74 deletions

View file

@ -28,7 +28,7 @@ var _ = Describe("Version Negotiation Packets", func() {
data, err := ComposeVersionNegotiation(destConnID, srcConnID, versions)
Expect(err).ToNot(HaveOccurred())
Expect(data[0] & 0x80).ToNot(BeZero())
hdr, err := parseHeader(bytes.NewReader(data), protocol.PerspectiveServer)
hdr, err := parseHeader(bytes.NewReader(data))
Expect(err).ToNot(HaveOccurred())
Expect(hdr.IsVersionNegotiation).To(BeTrue())
Expect(hdr.DestConnectionID).To(Equal(destConnID))