From 5ab53f483aedb77083fd0622da8f80e462319f8b Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 22 Jul 2019 10:52:27 +0200 Subject: Fixed unnecessary conversions (#304) No need to convert these types. --- dhcpv4/nclient4/conn_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dhcpv4/nclient4/conn_linux.go') diff --git a/dhcpv4/nclient4/conn_linux.go b/dhcpv4/nclient4/conn_linux.go index d6edc38..af6485f 100644 --- a/dhcpv4/nclient4/conn_linux.go +++ b/dhcpv4/nclient4/conn_linux.go @@ -140,14 +140,14 @@ func (upc *BroadcastRawUDPConn) ReadFrom(b []byte) (int, net.Addr, error) { udpHdr := UDP(buf.Consume(udpHdrLen)) addr := &net.UDPAddr{ - IP: net.IP(ipHdr.DestinationAddress()), + IP: ipHdr.DestinationAddress(), Port: int(udpHdr.DestinationPort()), } if !udpMatch(addr, upc.boundAddr) { continue } srcAddr := &net.UDPAddr{ - IP: net.IP(ipHdr.SourceAddress()), + IP: ipHdr.SourceAddress(), Port: int(udpHdr.SourcePort()), } // Extra padding after end of IP packet should be ignored, -- cgit v1.2.3