mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-22 21:08:38 +00:00
wgengine/magicsock: improve Rebind logging
We were accidentally logging oldPort -> oldPort. Log oldPort as well as c.port; if we failed to get the preferred port in a previous rebind, oldPort might differ from c.port. Signed-off-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
15ceacc4c5
commit
98714e784b
@ -2658,10 +2658,10 @@ func (c *Conn) Rebind() {
|
|||||||
c.pconn4.mu.Unlock()
|
c.pconn4.mu.Unlock()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
newPort := c.pconn4.localAddrLocked().Port
|
newPort := packetConn.LocalAddr().(*net.UDPAddr).Port
|
||||||
c.logf("magicsock: link change rebound port: from %v to %v (failed to get %v)", oldPort, newPort, c.port)
|
c.logf("magicsock: link change rebound port: from %v to %v (failed to get %v)", oldPort, newPort, c.port)
|
||||||
} else {
|
} else {
|
||||||
c.logf("magicsock: link change rebound port: %d", c.port)
|
c.logf("magicsock: link change rebound port from %d to %d", oldPort, c.port)
|
||||||
}
|
}
|
||||||
c.pconn4.pconn = packetConn.(*net.UDPConn)
|
c.pconn4.pconn = packetConn.(*net.UDPConn)
|
||||||
c.pconn4.mu.Unlock()
|
c.pconn4.mu.Unlock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user