wgengine/magicsock: handle CallMeMaybe discovery mesages

Roughly feature complete now. Testing and polish remains.

Updates #483
This commit is contained in:
Brad Fitzpatrick
2020-07-01 15:28:14 -07:00
parent 710ee88e94
commit 77e89c4a72
2 changed files with 56 additions and 48 deletions

View File

@@ -860,8 +860,10 @@ func TestDiscoMessage(t *testing.T) {
c := newConn()
c.logf = t.Logf
c.SetDiscoPrivateKey(key.NewPrivate())
c.nodeOfDisco = map[tailcfg.DiscoKey]*tailcfg.Node{
tailcfg.DiscoKey(peer1Pub): &tailcfg.Node{Key: tailcfg.NodeKey{1: 1}},
c.endpointOfDisco = map[tailcfg.DiscoKey]*discoEndpoint{
tailcfg.DiscoKey(peer1Pub): &discoEndpoint{
// ...
},
}
const payload = "why hello"