mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-13 06:07:34 +00:00
ipn/ipnlocal: rename/document peerapi stuff a bit, pass self identity
So handlers can vary based on whether owner of peer matches owner of local node. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
@@ -1448,6 +1448,10 @@ func (b *LocalBackend) initPeerAPIListener() {
|
||||
}
|
||||
b.peerAPIListeners = nil
|
||||
|
||||
if len(b.netMap.Addresses) == 0 || b.netMap.SelfNode == nil {
|
||||
return
|
||||
}
|
||||
|
||||
var tunName string
|
||||
if ge, ok := b.e.(wgengine.InternalsGetter); ok {
|
||||
tunDev, _ := ge.GetInternals()
|
||||
@@ -1461,8 +1465,9 @@ func (b *LocalBackend) initPeerAPIListener() {
|
||||
continue
|
||||
}
|
||||
pln := &peerAPIListener{
|
||||
ln: ln,
|
||||
lb: b,
|
||||
ln: ln,
|
||||
lb: b,
|
||||
selfNode: b.netMap.SelfNode,
|
||||
}
|
||||
pln.urlStr = "http://" + net.JoinHostPort(a.IP.String(), strconv.Itoa(pln.Port()))
|
||||
|
||||
|
Reference in New Issue
Block a user