@ -2767,13 +2767,13 @@ func (c *Conn) ParseEndpoint(keyAddrs string) (conn.Endpoint, error) {
return nil , fmt . Errorf ( "magicsock: invalid discokey endpoint %q for %v: %w" , addrs , pk . ShortString ( ) , err )
return nil , fmt . Errorf ( "magicsock: invalid discokey endpoint %q for %v: %w" , addrs , pk . ShortString ( ) , err )
}
}
de := & discoEndpoint {
de := & discoEndpoint {
c : c ,
c : c ,
publicKey : tailcfg . NodeKey ( pk ) , // peer public key (for WireGuard + DERP)
publicKey : tailcfg . NodeKey ( pk ) , // peer public key (for WireGuard + DERP)
discoKey : tailcfg . DiscoKey ( discoKey ) , // for discovery mesages
discoKey : tailcfg . DiscoKey ( discoKey ) , // for discovery mesages
discoShort : tailcfg . DiscoKey ( discoKey ) . ShortString ( ) ,
discoShort : tailcfg . DiscoKey ( discoKey ) . ShortString ( ) ,
wgEndpoint HostPort : addrs ,
wgEndpoint : addrs ,
sentPing : map [ stun . TxID ] sentPing { } ,
sentPing : map [ stun . TxID ] sentPing { } ,
endpointState : map [ netaddr . IPPort ] * endpointState { } ,
endpointState : map [ netaddr . IPPort ] * endpointState { } ,
}
}
de . initFakeUDPAddr ( )
de . initFakeUDPAddr ( )
de . updateFromNode ( c . nodeOfDisco [ de . discoKey ] )
de . updateFromNode ( c . nodeOfDisco [ de . discoKey ] )
@ -3110,12 +3110,12 @@ type discoEndpoint struct {
numStopAndResetAtomic int64
numStopAndResetAtomic int64
// These fields are initialized once and never modified.
// These fields are initialized once and never modified.
c * Conn
c * Conn
publicKey tailcfg . NodeKey // peer public key (for WireGuard + DERP)
publicKey tailcfg . NodeKey // peer public key (for WireGuard + DERP)
discoKey tailcfg . DiscoKey // for discovery mesages
discoKey tailcfg . DiscoKey // for discovery mesages
discoShort string // ShortString of discoKey
discoShort string // ShortString of discoKey
fakeWGAddr netaddr . IPPort // the UDP address we tell wireguard-go we're using
fakeWGAddr netaddr . IPPort // the UDP address we tell wireguard-go we're using
wgEndpoint HostPort string // string from ParseEndpoint: "<hex-discovery-key>.disco.tailscale:12345"
wgEndpoint string // string from ParseEndpoint: "<hex-discovery-key>.disco.tailscale:12345"
// Owned by Conn.mu:
// Owned by Conn.mu:
lastPingFrom netaddr . IPPort
lastPingFrom netaddr . IPPort
@ -3295,7 +3295,7 @@ func (de *discoEndpoint) String() string {
func ( de * discoEndpoint ) ClearSrc ( ) { }
func ( de * discoEndpoint ) ClearSrc ( ) { }
func ( de * discoEndpoint ) SrcToString ( ) string { panic ( "unused" ) } // unused by wireguard-go
func ( de * discoEndpoint ) SrcToString ( ) string { panic ( "unused" ) } // unused by wireguard-go
func ( de * discoEndpoint ) SrcIP ( ) net . IP { panic ( "unused" ) } // unused by wireguard-go
func ( de * discoEndpoint ) SrcIP ( ) net . IP { panic ( "unused" ) } // unused by wireguard-go
func ( de * discoEndpoint ) DstToString ( ) string { return de . wgEndpoint HostPort }
func ( de * discoEndpoint ) DstToString ( ) string { return de . wgEndpoint }
func ( de * discoEndpoint ) DstIP ( ) net . IP { panic ( "unused" ) }
func ( de * discoEndpoint ) DstIP ( ) net . IP { panic ( "unused" ) }
func ( de * discoEndpoint ) DstToBytes ( ) [ ] byte { return packIPPort ( de . fakeWGAddr ) }
func ( de * discoEndpoint ) DstToBytes ( ) [ ] byte { return packIPPort ( de . fakeWGAddr ) }