derp, wgengine/magicsock: support more than just packets from Client.Recv

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-02-20 19:10:54 -08:00
committed by Brad Fitzpatrick
parent 88f1cc0c98
commit 379a3125fd
7 changed files with 63 additions and 27 deletions

View File

@@ -76,13 +76,18 @@ func TestSendRecv(t *testing.T) {
go func(i int) {
for {
b := make([]byte, 1<<16)
n, err := clients[i].Recv(b)
m, err := clients[i].Recv(b)
if err != nil {
errCh <- err
return
}
b = b[:n]
recvChs[i] <- b
switch m := m.(type) {
default:
t.Errorf("unexpected message type %T", m)
continue
case ReceivedPacket:
recvChs[i] <- []byte(m)
}
}
}(i)
}