summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/option_requested_ip_address.go
diff options
context:
space:
mode:
authorChristopher Koch <chrisko@google.com>2018-12-29 09:16:15 -0800
committerinsomniac <insomniacslk@users.noreply.github.com>2019-01-11 19:38:21 +0000
commit9492662dae0651fd4d6698d35b58ade7300e149e (patch)
tree77f53ebd6dfded05880c322005909b97a1cf140c /dhcpv4/option_requested_ip_address.go
parent512011c2eb80a7c0316405ef7aaae6e0b5b09b1c (diff)
dhcpv4: simplify marshaling options to binary.
- Consolidate writing the option code and length to Options.Marshal rather than doing it in each individual option. - Use uio in marshaling code.
Diffstat (limited to 'dhcpv4/option_requested_ip_address.go')
-rw-r--r--dhcpv4/option_requested_ip_address.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/dhcpv4/option_requested_ip_address.go b/dhcpv4/option_requested_ip_address.go
index 3539278..403f262 100644
--- a/dhcpv4/option_requested_ip_address.go
+++ b/dhcpv4/option_requested_ip_address.go
@@ -30,8 +30,7 @@ func (o *OptRequestedIPAddress) Code() OptionCode {
// ToBytes returns a serialized stream of bytes for this option.
func (o *OptRequestedIPAddress) ToBytes() []byte {
- ret := []byte{byte(o.Code()), byte(o.Length())}
- return append(ret, o.RequestedAddr.To4()...)
+ return o.RequestedAddr.To4()
}
// String returns a human-readable string.