diff --git a/client.go b/client.go index 8d13c0484..f057331d1 100644 --- a/client.go +++ b/client.go @@ -308,11 +308,6 @@ func (c *client) handlePacketImpl(p *receivedPacket) error { return err } - // reject packets with the wrong connection ID - if !p.hdr.DestConnectionID.Equal(c.srcConnID) { - return fmt.Errorf("received a packet with an unexpected connection ID (%s, expected %s)", p.hdr.DestConnectionID, c.srcConnID) - } - if p.hdr.Type == protocol.PacketTypeRetry { c.handleRetryPacket(p.hdr) return nil diff --git a/client_test.go b/client_test.go index 8d865bb30..5cd8b1abf 100644 --- a/client_test.go +++ b/client_test.go @@ -5,7 +5,6 @@ import ( "context" "crypto/tls" "errors" - "fmt" "net" "os" "time" @@ -735,18 +734,4 @@ var _ = Describe("Client", func() { Expect(cl.version).ToNot(BeZero()) Expect(cl.GetVersion()).To(Equal(cl.version)) }) - - It("ignores packets with the wrong destination connection ID", func() { - cl.session = NewMockQuicSession(mockCtrl) // don't EXPECT any handlePacket calls - connID2 := protocol.ConnectionID{8, 7, 6, 5, 4, 3, 2, 1} - Expect(connID).ToNot(Equal(connID2)) - Expect(cl.handlePacketImpl(&receivedPacket{ - remoteAddr: addr, - hdr: &wire.Header{ - DestConnectionID: connID2, - SrcConnectionID: connID, - Version: cl.version, - }, - })).To(MatchError(fmt.Sprintf("received a packet with an unexpected connection ID (0x0807060504030201, expected %s)", connID))) - }) })