Skip to content

Commit 16eef96

Browse files
committed
don't kill agent connection on invalid RFH
1 parent e1283a6 commit 16eef96

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tailnet/coordinator.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,12 @@ func (c *core) handleReadyForHandshakeLocked(src *peer, rfhs []*proto.Coordinate
717717
}
718718

719719
if !c.tunnels.tunnelExists(src.id, dstID) {
720-
return xerrors.Errorf("tunnel does not exist between %s and %s", src.id.String(), dstID.String())
720+
// We intentionally do not return an error here, since it's
721+
// inherently racy. It's possible for a source to connect, then
722+
// subsequently disconnect before the agent has sent back the RFH.
723+
// Since this could potentially happen to a non-malicious agent, we
724+
// don't want to kill its connection.
725+
continue
721726
}
722727

723728
dst, ok := c.peers[dstID]

0 commit comments

Comments
 (0)