mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-05 20:26:47 +02:00
wgengine/magicsock: add missing log messages
Change-Id: I718676187672836341792002db3d0f7875d5f425
This commit is contained in:
parent
1633a8e0fe
commit
2f07c6a9f4
@ -111,7 +111,19 @@ func (c *RebindingUDPConn) WriteBatchTo(buffs [][]byte, addr netip.AddrPort) (re
|
||||
// ReadBatch reads messages from c into msgs. It returns the number of messages
|
||||
// the caller should evaluate for nonzero len, as a zero len message may fall
|
||||
// on either side of a nonzero.
|
||||
func (c *RebindingUDPConn) ReadBatch(msgs []ipv6.Message, flags int) (int, error) {
|
||||
func (c *RebindingUDPConn) ReadBatch(msgs []ipv6.Message, flags int) (retN int, retErr error) {
|
||||
defer func() {
|
||||
sawTestAddr := false
|
||||
for _, msg := range msgs {
|
||||
if msg.Addr.String() == testAddr.String() {
|
||||
sawTestAddr = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if sawTestAddr {
|
||||
c.logf("RebindingUDPConn.ReadBatch([]ipv6.Message{/* %d */}, 0x%x) = (%d, %v)", len(msgs), flags, retN, retErr)
|
||||
}
|
||||
}()
|
||||
for {
|
||||
pconn := *c.pconnAtomic.Load()
|
||||
b, ok := pconn.(*batchingUDPConn)
|
||||
@ -178,5 +190,9 @@ func (c *RebindingUDPConn) writeToUDPAddrPortWithInitPconn(pconn nettype.PacketC
|
||||
}
|
||||
|
||||
func (c *RebindingUDPConn) WriteToUDPAddrPort(b []byte, addr netip.AddrPort) (int, error) {
|
||||
return c.writeToUDPAddrPortWithInitPconn(*c.pconnAtomic.Load(), b, addr)
|
||||
n, err := c.writeToUDPAddrPortWithInitPconn(*c.pconnAtomic.Load(), b, addr)
|
||||
if addr.Addr() == testAddr {
|
||||
c.logf("RebindingUDPConn.WriteToUDPAddrPort([]byte{/* %d */}, %v) = (%d, %v)", len(b), addr, n, err)
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user