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>pull/1749/head
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…
Reference in New Issue