mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
wgengine/magicsock: remove allocs in UDP write, use new netaddr.PutUDPAddr
The allocs were only introduced yesterday with a TODO. Now they're gone again.
This commit is contained in:
parent
7b3c0bb7f6
commit
9b8ca219a1
2
go.mod
2
go.mod
@ -29,6 +29,6 @@ require (
|
||||
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
|
||||
honnef.co/go/tools v0.0.1-2020.1.4 // indirect
|
||||
inet.af/netaddr v0.0.0-20200629220211-f44a6d25c536
|
||||
inet.af/netaddr v0.0.0-20200701171350-6509743f79d9
|
||||
rsc.io/goversion v1.2.0
|
||||
)
|
||||
|
2
go.sum
2
go.sum
@ -162,5 +162,7 @@ inet.af/netaddr v0.0.0-20200513162223-787f13e36cbe h1:WjJ6wZhXEWQA3FFSwOjG8tO2q1
|
||||
inet.af/netaddr v0.0.0-20200513162223-787f13e36cbe/go.mod h1:qqYzz/2whtrbWJvt+DNWQyvekNN4ePQZcg2xc2/Yjww=
|
||||
inet.af/netaddr v0.0.0-20200629220211-f44a6d25c536 h1:XFVw2MVOtmHBidx70M+I6vIw2F6f55UyXvkiKfIrE38=
|
||||
inet.af/netaddr v0.0.0-20200629220211-f44a6d25c536/go.mod h1:qqYzz/2whtrbWJvt+DNWQyvekNN4ePQZcg2xc2/Yjww=
|
||||
inet.af/netaddr v0.0.0-20200701171350-6509743f79d9 h1:F41nQsn8UGDPDXsOPwZQiaK8BmItPzyb0PYgjJSYIzw=
|
||||
inet.af/netaddr v0.0.0-20200701171350-6509743f79d9/go.mod h1:qqYzz/2whtrbWJvt+DNWQyvekNN4ePQZcg2xc2/Yjww=
|
||||
rsc.io/goversion v1.2.0 h1:SPn+NLTiAG7w30IRK/DKp1BjvpWabYgxlLp/+kx5J8w=
|
||||
rsc.io/goversion v1.2.0/go.mod h1:Eih9y/uIBS3ulggl7KNJ09xGSLcuNaLgmvvqa07sgfo=
|
||||
|
@ -805,8 +805,9 @@ func (c *Conn) Send(b []byte, ep conn.Endpoint) error {
|
||||
|
||||
// sendUDP sends UDP packet b to ipp.
|
||||
func (c *Conn) sendUDP(ipp netaddr.IPPort, b []byte) error {
|
||||
addr := ipp.UDPAddr() // TOOD(bradfitz): add alloc-free netaddr.WriteTo helper
|
||||
return c.sendUDPStd(addr, b)
|
||||
ua := ipp.UDPAddr()
|
||||
defer netaddr.PutUDPAddr(ua)
|
||||
return c.sendUDPStd(ua, b)
|
||||
}
|
||||
|
||||
func (c *Conn) sendUDPStd(addr *net.UDPAddr, b []byte) (err error) {
|
||||
|
Loading…
Reference in New Issue
Block a user