diff options
author | Christian Muehlhaeuser <muesli@gmail.com> | 2019-07-22 11:12:54 +0200 |
---|---|---|
committer | Pablo Mazzini <pmazzini@gmail.com> | 2019-07-22 10:12:54 +0100 |
commit | f672bc204f35cdafd26aeefa5faf44ab4de7c4dc (patch) | |
tree | 12191ce4a1b7308a7f7b45c1dedeafc8581ec690 | |
parent | 5ab53f483aedb77083fd0622da8f80e462319f8b (diff) |
Fixed unnecessary conversions in dhcpv6 (#305)
No need to convert here.
-rw-r--r-- | dhcpv6/dhcpv6relay.go | 2 | ||||
-rw-r--r-- | dhcpv6/option_elapsedtime.go | 2 | ||||
-rw-r--r-- | dhcpv6/option_remoteid.go | 2 | ||||
-rw-r--r-- | dhcpv6/option_vendor_opts.go | 2 | ||||
-rw-r--r-- | dhcpv6/option_vendorclass.go | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/dhcpv6/dhcpv6relay.go b/dhcpv6/dhcpv6relay.go index 1506dc4..02ed9bb 100644 --- a/dhcpv6/dhcpv6relay.go +++ b/dhcpv6/dhcpv6relay.go @@ -57,7 +57,7 @@ func (r *RelayMessage) Summary() string { func (r *RelayMessage) ToBytes() []byte { buf := uio.NewBigEndianBuffer(make([]byte, 0, RelayHeaderSize)) buf.Write8(byte(r.MessageType)) - buf.Write8(byte(r.HopCount)) + buf.Write8(r.HopCount) buf.WriteBytes(r.LinkAddr.To16()) buf.WriteBytes(r.PeerAddr.To16()) buf.WriteBytes(r.Options.ToBytes()) diff --git a/dhcpv6/option_elapsedtime.go b/dhcpv6/option_elapsedtime.go index 2d65843..194122e 100644 --- a/dhcpv6/option_elapsedtime.go +++ b/dhcpv6/option_elapsedtime.go @@ -21,7 +21,7 @@ func (op *OptElapsedTime) Code() OptionCode { // ToBytes marshals this option to bytes. func (op *OptElapsedTime) ToBytes() []byte { buf := uio.NewBigEndianBuffer(nil) - buf.Write16(uint16(op.ElapsedTime)) + buf.Write16(op.ElapsedTime) return buf.Data() } diff --git a/dhcpv6/option_remoteid.go b/dhcpv6/option_remoteid.go index 5b7d633..e6803c6 100644 --- a/dhcpv6/option_remoteid.go +++ b/dhcpv6/option_remoteid.go @@ -21,7 +21,7 @@ func (op *OptRemoteId) Code() OptionCode { // ToBytes serializes this option to a byte stream. func (op *OptRemoteId) ToBytes() []byte { buf := uio.NewBigEndianBuffer(nil) - buf.Write32(uint32(op.enterpriseNumber)) + buf.Write32(op.enterpriseNumber) buf.WriteBytes(op.remoteId) return buf.Data() } diff --git a/dhcpv6/option_vendor_opts.go b/dhcpv6/option_vendor_opts.go index a1ae400..e1aebd4 100644 --- a/dhcpv6/option_vendor_opts.go +++ b/dhcpv6/option_vendor_opts.go @@ -23,7 +23,7 @@ func (op *OptVendorOpts) Code() OptionCode { // ToBytes serializes the option and returns it as a sequence of bytes func (op *OptVendorOpts) ToBytes() []byte { buf := uio.NewBigEndianBuffer(nil) - buf.Write32(uint32(op.EnterpriseNumber)) + buf.Write32(op.EnterpriseNumber) buf.WriteData(op.VendorOpts.ToBytes()) return buf.Data() } diff --git a/dhcpv6/option_vendorclass.go b/dhcpv6/option_vendorclass.go index ef85087..94152a1 100644 --- a/dhcpv6/option_vendorclass.go +++ b/dhcpv6/option_vendorclass.go @@ -22,7 +22,7 @@ func (op *OptVendorClass) Code() OptionCode { // ToBytes serializes the option and returns it as a sequence of bytes func (op *OptVendorClass) ToBytes() []byte { buf := uio.NewBigEndianBuffer(nil) - buf.Write32(uint32(op.EnterpriseNumber)) + buf.Write32(op.EnterpriseNumber) for _, data := range op.Data { buf.Write16(uint16(len(data))) buf.WriteBytes(data) |