summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/dhcpv4.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4/dhcpv4.go')
-rw-r--r--dhcpv4/dhcpv4.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/dhcpv4/dhcpv4.go b/dhcpv4/dhcpv4.go
index 57342d8..24e3ed0 100644
--- a/dhcpv4/dhcpv4.go
+++ b/dhcpv4/dhcpv4.go
@@ -429,6 +429,8 @@ func writeIP(b *uio.Lexer, ip net.IP) {
if ip == nil {
b.WriteBytes(zeros[:])
} else {
+ // Converting IP to 4 byte format
+ ip = ip.To4()
b.WriteBytes(ip[:net.IPv4len])
}
}