wgengine/magicsock: use relatively new netaddr.IPPort.IsZero method

This commit is contained in:
Brad Fitzpatrick 2021-01-15 19:21:10 -08:00
parent 4811236189
commit 3fa86a8b23

View File

@ -1509,7 +1509,7 @@ func (c *Conn) ReceiveIPv4(b []byte) (n int, ep conn.Endpoint, err error) {
var addr *net.UDPAddr
Top:
// First, process any buffered packet from earlier.
if from := c.bufferedIPv4From; from != (netaddr.IPPort{}) {
if from := c.bufferedIPv4From; !from.IsZero() {
c.bufferedIPv4From = netaddr.IPPort{}
addr = from.UDPAddr()
ep := c.findEndpoint(from, addr, c.bufferedIPv4Packet)