diff options
Diffstat (limited to 'dhcpv4/dhcpv4.go')
-rw-r--r-- | dhcpv4/dhcpv4.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dhcpv4/dhcpv4.go b/dhcpv4/dhcpv4.go index 2d73003..7965161 100644 --- a/dhcpv4/dhcpv4.go +++ b/dhcpv4/dhcpv4.go @@ -690,10 +690,10 @@ func (d *DHCPv4) ToBytes() []byte { ret = append(ret, u16...) binary.BigEndian.PutUint16(u16, d.flags) ret = append(ret, u16...) - ret = append(ret, d.clientIPAddr[:4]...) - ret = append(ret, d.yourIPAddr[:4]...) - ret = append(ret, d.serverIPAddr[:4]...) - ret = append(ret, d.gatewayIPAddr[:4]...) + ret = append(ret, d.clientIPAddr.To4()...) + ret = append(ret, d.yourIPAddr.To4()...) + ret = append(ret, d.serverIPAddr.To4()...) + ret = append(ret, d.gatewayIPAddr.To4()...) ret = append(ret, d.clientHwAddr[:16]...) ret = append(ret, d.serverHostName[:64]...) ret = append(ret, d.bootFileName[:128]...) |