summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4')
-rw-r--r--dhcpv4/nclient4/conn_linux.go4
-rw-r--r--dhcpv4/options.go2
2 files changed, 3 insertions, 3 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,
diff --git a/dhcpv4/options.go b/dhcpv4/options.go
index 11db5f7..ea902f6 100644
--- a/dhcpv4/options.go
+++ b/dhcpv4/options.go
@@ -195,7 +195,7 @@ func (o Options) Marshal(b *uio.Lexer) {
// option is simply listed multiple times.
for len(data) > 0 {
// 1 byte: option code
- b.Write8(uint8(code))
+ b.Write8(code)
n := len(data)
if n > math.MaxUint8 {