wgengine, magicsock: add a CreateBind method

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
David Crawshaw
2020-03-03 10:39:02 -05:00
committed by David Crawshaw
parent 75e62d318f
commit 34859f8e7d
2 changed files with 6 additions and 4 deletions

View File

@@ -1094,6 +1094,11 @@ func (a *AddrSet) Addrs() []wgcfg.Endpoint {
return eps
}
// CreateBind is called by WireGuard to create a UDP binding.
func (c *Conn) CreateBind(uint16) (conn.Bind, uint16, error) {
return c, c.LocalPort(), nil
}
// CreateEndpoint is called by WireGuard to connect to an endpoint.
// The key is the public key of the peer and addrs is a
// comma-separated list of UDP ip:ports.