diff options
author | Akshay Navale <navale@fb.com> | 2019-04-02 15:45:56 -0700 |
---|---|---|
committer | insomniac <insomniacslk@users.noreply.github.com> | 2019-04-03 00:17:07 +0100 |
commit | d862affa8b379318605a75c0f6f8fd00f8fed238 (patch) | |
tree | 6c4c8e6fa5227d5e7a214c66d33d884109c74a6f /dhcpv4/dhcpv4.go | |
parent | 83151f88146676ea6a0e60d52521a0bc342af746 (diff) |
Modifying the writeIP function to always write IPv4 in 4 byte long format.
Diffstat (limited to 'dhcpv4/dhcpv4.go')
-rw-r--r-- | dhcpv4/dhcpv4.go | 2 |
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]) } } |