Apply Tailscale endpoint awareness

This commit is contained in:
世界 2026-05-17 20:12:11 +08:00
parent 749db0015c
commit 414291f6d6
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
3 changed files with 45 additions and 2 deletions

View file

@ -359,7 +359,7 @@ func (device *Device) RoutineHandshake(id int) {
// consume initiation
peer := device.ConsumeMessageInitiation(&msg)
peer := device.ConsumeMessageInitiation(&msg, elem.endpoint)
if peer == nil {
device.log.Verbosef("Received invalid initiation message from %s", elem.endpoint.DstToString())
goto skip
@ -459,6 +459,9 @@ func (peer *Peer) RoutineSequentialReceiver(maxBatchSize int) {
peer.timersHandshakeComplete()
peer.SendStagedPackets()
}
if ep, ok := elem.endpoint.(conn.PeerAwareEndpoint); ok {
ep.FromPeer(peer.handshake.remoteStatic)
}
rxBytesLen += uint64(len(elem.packet) + MinMessageSize)
if len(elem.packet) == 0 {