diff options
author | Christian Muehlhaeuser <muesli@gmail.com> | 2019-07-22 10:52:27 +0200 |
---|---|---|
committer | Pablo Mazzini <pmazzini@gmail.com> | 2019-07-22 09:52:27 +0100 |
commit | 5ab53f483aedb77083fd0622da8f80e462319f8b (patch) | |
tree | d982b398b0c56bf7e3fe85e510a2423c4b4180e6 /dhcpv4/nclient4/conn_linux.go | |
parent | fb386c2f1b98064a7cd2afb459066f779cd36d59 (diff) |
Fixed unnecessary conversions (#304)
No need to convert these types.
Diffstat (limited to 'dhcpv4/nclient4/conn_linux.go')
-rw-r--r-- | dhcpv4/nclient4/conn_linux.go | 4 |
1 files changed, 2 insertions, 2 deletions
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, |