diff --git a/packet_packer.go b/packet_packer.go index 43ff8e36..6070dd90 100644 --- a/packet_packer.go +++ b/packet_packer.go @@ -214,6 +214,7 @@ func (p *packetPacker) packHandshakeRetransmission(packet *ackhandler.Packet) (* p.hasSentPacket = false } header := p.getHeader(packet.EncryptionLevel) + header.Type = packet.PacketType var frames []wire.Frame if p.version.UsesStopWaitingFrames() { // for gQUIC: pack a STOP_WAITING first if p.stopWaiting == nil { diff --git a/packet_packer_test.go b/packet_packer_test.go index 57ab1b26..e620869c 100644 --- a/packet_packer_test.go +++ b/packet_packer_test.go @@ -616,12 +616,14 @@ var _ = Describe("Packet packer", func() { It("packs a retransmission for a packet sent with no encryption", func() { packet := &ackhandler.Packet{ + PacketType: protocol.PacketTypeHandshake, EncryptionLevel: protocol.EncryptionUnencrypted, Frames: []wire.Frame{sf}, } p, err := packer.PackRetransmission(packet) Expect(err).ToNot(HaveOccurred()) Expect(p).To(HaveLen(1)) + Expect(p[0].header.Type).To(Equal(protocol.PacketTypeHandshake)) Expect(p[0].frames).To(Equal([]wire.Frame{swf, sf})) Expect(p[0].encryptionLevel).To(Equal(protocol.EncryptionUnencrypted)) })