diff options
Diffstat (limited to 'dhcpv4')
-rw-r--r-- | dhcpv4/bsdp/bsdp_test.go | 2 | ||||
-rw-r--r-- | dhcpv4/dhcpv4.go | 12 | ||||
-rw-r--r-- | dhcpv4/dhcpv4_test.go | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/dhcpv4/bsdp/bsdp_test.go b/dhcpv4/bsdp/bsdp_test.go index 9f756a7..ce09324 100644 --- a/dhcpv4/bsdp/bsdp_test.go +++ b/dhcpv4/bsdp/bsdp_test.go @@ -106,7 +106,7 @@ func TestNewInformList_ReplyPort(t *testing.T) { func newAck(hwAddr net.HardwareAddr, transactionID [4]byte) *dhcpv4.DHCPv4 { ack, _ := dhcpv4.New() ack.TransactionID = transactionID - ack.HWType = iana.HwTypeEthernet + ack.HWType = iana.HWTypeEthernet ack.ClientHWAddr = hwAddr ack.AddOption(&dhcpv4.OptMessageType{MessageType: dhcpv4.MessageTypeAck}) ack.AddOption(&dhcpv4.OptionGeneric{OptionCode: dhcpv4.OptionEnd}) diff --git a/dhcpv4/dhcpv4.go b/dhcpv4/dhcpv4.go index 0f2a5b4..f4e3596 100644 --- a/dhcpv4/dhcpv4.go +++ b/dhcpv4/dhcpv4.go @@ -33,7 +33,7 @@ var magicCookie = [4]byte{99, 130, 83, 99} // to build DHCPv4 packets. type DHCPv4 struct { OpCode OpcodeType - HWType iana.HwTypeType + HWType iana.HWType HopCount uint8 TransactionID TransactionID NumSeconds uint16 @@ -113,7 +113,7 @@ func New() (*DHCPv4, error) { } d := DHCPv4{ OpCode: OpcodeBootRequest, - HWType: iana.HwTypeEthernet, + HWType: iana.HWTypeEthernet, HopCount: 0, TransactionID: xid, NumSeconds: 0, @@ -149,7 +149,7 @@ func NewDiscovery(hwaddr net.HardwareAddr) (*DHCPv4, error) { } // get hw addr d.OpCode = OpcodeBootRequest - d.HWType = iana.HwTypeEthernet + d.HWType = iana.HWTypeEthernet d.ClientHWAddr = hwaddr d.SetBroadcast() d.AddOption(&OptMessageType{MessageType: MessageTypeDiscover}) @@ -202,7 +202,7 @@ func NewInform(hwaddr net.HardwareAddr, localIP net.IP) (*DHCPv4, error) { } d.OpCode = OpcodeBootRequest - d.HWType = iana.HwTypeEthernet + d.HWType = iana.HWTypeEthernet d.ClientHWAddr = hwaddr d.ClientIPAddr = localIP d.AddOption(&OptMessageType{MessageType: MessageTypeInform}) @@ -269,7 +269,7 @@ func FromBytes(q []byte) (*DHCPv4, error) { buf := uio.NewBigEndianBuffer(q) p.OpCode = OpcodeType(buf.Read8()) - p.HWType = iana.HwTypeType(buf.Read8()) + p.HWType = iana.HWType(buf.Read8()) hwAddrLen := buf.Read8() @@ -502,7 +502,7 @@ func (d *DHCPv4) ToBytes() []byte { // HwAddrLen hlen := uint8(len(d.ClientHWAddr)) - if hlen == 0 && d.HWType == iana.HwTypeEthernet { + if hlen == 0 && d.HWType == iana.HWTypeEthernet { hlen = 6 } buf.Write8(hlen) diff --git a/dhcpv4/dhcpv4_test.go b/dhcpv4/dhcpv4_test.go index 276b0fb..e5b8ad6 100644 --- a/dhcpv4/dhcpv4_test.go +++ b/dhcpv4/dhcpv4_test.go @@ -63,7 +63,7 @@ func TestFromBytes(t *testing.T) { d, err := FromBytes(data) require.NoError(t, err) require.Equal(t, d.OpCode, OpcodeBootRequest) - require.Equal(t, d.HWType, iana.HwTypeEthernet) + require.Equal(t, d.HWType, iana.HWTypeEthernet) require.Equal(t, d.HopCount, byte(3)) require.Equal(t, d.TransactionID, TransactionID{0xaa, 0xbb, 0xcc, 0xdd}) require.Equal(t, d.NumSeconds, uint16(3)) @@ -302,7 +302,7 @@ func TestNewDiscovery(t *testing.T) { // Validate fields of DISCOVER packet. require.Equal(t, OpcodeBootRequest, m.OpCode) - require.Equal(t, iana.HwTypeEthernet, m.HWType) + require.Equal(t, iana.HWTypeEthernet, m.HWType) require.Equal(t, hwAddr, m.ClientHWAddr) require.True(t, m.IsBroadcast()) require.True(t, m.Options.Has(OptionParameterRequestList)) @@ -316,7 +316,7 @@ func TestNewInform(t *testing.T) { require.NoError(t, err) require.Equal(t, OpcodeBootRequest, m.OpCode) - require.Equal(t, iana.HwTypeEthernet, m.HWType) + require.Equal(t, iana.HWTypeEthernet, m.HWType) require.Equal(t, hwAddr, m.ClientHWAddr) require.Equal(t, MessageTypeInform, m.MessageType()) require.True(t, m.ClientIPAddr.Equal(localIP)) |