Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,15 @@ func (a *Agent) pingSelectedPairForPiggyback() {
if pair == nil {
pair = a.getBestValidCandidatePair()
}
// During a SPED handshake the pair may not be in the valid list yet: a lite
// controlled agent only validates a pair on nomination, so before that
// getBestValidCandidatePair returns nil and a server-role flight (e.g. the
// ServerHello) would otherwise sit un-carried until the peer's DTLS
// retransmit (~1 RTT). We already learned the remote from its piggybacked
// ClientHello, so fall back to the best available pair to carry the flight now.
if pair == nil && a.piggybackActive() {
pair = a.getBestAvailableCandidatePair()
}
if pair == nil {
return
}
Expand Down
13 changes: 12 additions & 1 deletion selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
}

func (s *controllingSelector) HandleSuccessResponse(
m *stun.Message, local, remote Candidate, remoteAddr netip.AddrPort,

Check failure on line 169 in selection.go

View workflow job for this annotation

GitHub Actions / lint / Go

parameter name 'm' is too short for the scope of its usage (varnamelen)
) {
ok, pendingRequest, rtt := s.agent.handleInboundBindingSuccess(m.TransactionID)
if !ok {
Expand Down Expand Up @@ -397,7 +397,7 @@
}

func (s *controlledSelector) HandleSuccessResponse(
m *stun.Message, local, remote Candidate, remoteAddr netip.AddrPort,

Check failure on line 400 in selection.go

View workflow job for this annotation

GitHub Actions / lint / Go

parameter name 'm' is too short for the scope of its usage (varnamelen)
) {
//nolint:godox
// TODO according to the standard we should specifically answer a failed nomination:
Expand Down Expand Up @@ -558,6 +558,17 @@
s.agent.setSelectedPair(pair)
}

func (s *liteSelector) PingCandidate(_, _ Candidate) {}
func (s *liteSelector) PingCandidate(local, remote Candidate) {
// Lite agents normally generate no connectivity checks (RFC 8445 §7), so this
// is a no-op. The one exception is while a DTLS-in-STUN (SPED) handshake is in
// flight: the agent must emit a binding request to carry its queued DTLS
// flight/ack to the peer. Without it a server-role flight (e.g. the
// ServerHello) sits un-carried until the peer's DTLS retransmit (~1 RTT),
// losing the SPED speedup. Bounded to the handshake window, so it does not
// reintroduce general lite connectivity checks.
if s.agent.piggybackActive() {
s.pairCandidateSelector.PingCandidate(local, remote)
}
}

func (s *liteSelector) HandleSuccessResponse(*stun.Message, Candidate, Candidate, netip.AddrPort) {}
Loading