mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-24 20:27:51 +00:00
wgengine/magicsock, etc: remove mostly unused WriteTo methods
Updates #2331 Updates #5162 Change-Id: I8291884425481eeaedde38a54adfd8ed7292a497 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
83c41f3697
commit
29f7df9d8f
@@ -3433,10 +3433,6 @@ func (c *batchingUDPConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) {
|
||||
return c.pc.ReadFrom(p)
|
||||
}
|
||||
|
||||
func (c *batchingUDPConn) WriteTo(b []byte, addr net.Addr) (n int, err error) {
|
||||
return c.pc.WriteTo(b, addr)
|
||||
}
|
||||
|
||||
func (c *batchingUDPConn) SetDeadline(t time.Time) error {
|
||||
return c.pc.SetDeadline(t)
|
||||
}
|
||||
@@ -3867,17 +3863,6 @@ func (c *RebindingUDPConn) writeToUDPAddrPortWithInitPconn(pconn nettype.PacketC
|
||||
}
|
||||
}
|
||||
|
||||
func (c *RebindingUDPConn) WriteTo(b []byte, addr net.Addr) (int, error) {
|
||||
for {
|
||||
pconn := *c.pconnAtomic.Load()
|
||||
n, err := pconn.WriteTo(b, addr)
|
||||
if err != nil && pconn != c.currentConn() {
|
||||
continue
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
}
|
||||
|
||||
func (c *RebindingUDPConn) WriteToUDPAddrPort(b []byte, addr netip.AddrPort) (int, error) {
|
||||
return c.writeToUDPAddrPortWithInitPconn(*c.pconnAtomic.Load(), b, addr)
|
||||
}
|
||||
@@ -3904,11 +3889,6 @@ func (c *blockForeverConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
|
||||
return 0, nil, net.ErrClosed
|
||||
}
|
||||
|
||||
func (c *blockForeverConn) WriteTo(p []byte, addr net.Addr) (n int, err error) {
|
||||
// Silently drop writes.
|
||||
return len(p), nil
|
||||
}
|
||||
|
||||
func (c *blockForeverConn) WriteToUDPAddrPort(p []byte, addr netip.AddrPort) (int, error) {
|
||||
// Silently drop writes.
|
||||
return len(p), nil
|
||||
|
Reference in New Issue
Block a user