diff options
Diffstat (limited to 'dhcpv6/option_relayport.go')
-rw-r--r-- | dhcpv6/option_relayport.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/dhcpv6/option_relayport.go b/dhcpv6/option_relayport.go index 4873693..8bf9eff 100644 --- a/dhcpv6/option_relayport.go +++ b/dhcpv6/option_relayport.go @@ -32,11 +32,10 @@ func (op *optRelayPort) String() string { return fmt.Sprintf("%s: %d", op.Code(), op.DownstreamSourcePort) } -// build an optRelayPort structure from a sequence of bytes. -// The input data does not include option code and length bytes. -func parseOptRelayPort(data []byte) (*optRelayPort, error) { - var opt optRelayPort +// FromBytes build an optRelayPort structure from a sequence of bytes. The +// input data does not include option code and length bytes. +func (op *optRelayPort) FromBytes(data []byte) error { buf := uio.NewBigEndianBuffer(data) - opt.DownstreamSourcePort = buf.Read16() - return &opt, buf.FinError() + op.DownstreamSourcePort = buf.Read16() + return buf.FinError() } |