mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 13:17:36 +03:00
fix race condition when dropping Initial packet with short connection ID (#4236)
This commit is contained in:
parent
54d6f7dc51
commit
f1b3bdbcb0
1 changed files with 1 additions and 1 deletions
|
@ -542,10 +542,10 @@ func (s *baseServer) validateToken(token *handshake.Token, addr net.Addr) bool {
|
||||||
|
|
||||||
func (s *baseServer) handleInitialImpl(p receivedPacket, hdr *wire.Header) error {
|
func (s *baseServer) handleInitialImpl(p receivedPacket, hdr *wire.Header) error {
|
||||||
if len(hdr.Token) == 0 && hdr.DestConnectionID.Len() < protocol.MinConnectionIDLenInitial {
|
if len(hdr.Token) == 0 && hdr.DestConnectionID.Len() < protocol.MinConnectionIDLenInitial {
|
||||||
p.buffer.Release()
|
|
||||||
if s.tracer != nil && s.tracer.DroppedPacket != nil {
|
if s.tracer != nil && s.tracer.DroppedPacket != nil {
|
||||||
s.tracer.DroppedPacket(p.remoteAddr, logging.PacketTypeInitial, p.Size(), logging.PacketDropUnexpectedPacket)
|
s.tracer.DroppedPacket(p.remoteAddr, logging.PacketTypeInitial, p.Size(), logging.PacketDropUnexpectedPacket)
|
||||||
}
|
}
|
||||||
|
p.buffer.Release()
|
||||||
return errors.New("too short connection ID")
|
return errors.New("too short connection ID")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue