summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4')
-rw-r--r--dhcpv4/dhcpv4.go6
-rw-r--r--dhcpv4/option_archtype.go3
2 files changed, 2 insertions, 7 deletions
diff --git a/dhcpv4/dhcpv4.go b/dhcpv4/dhcpv4.go
index eebc1b0..51621e9 100644
--- a/dhcpv4/dhcpv4.go
+++ b/dhcpv4/dhcpv4.go
@@ -327,11 +327,7 @@ func (d *DHCPv4) HwType() iana.HwTypeType {
// HwTypeToString returns the mnemonic name for the hardware type, e.g.
// "Ethernet". If the type is unknown, it returns "Unknown".
func (d *DHCPv4) HwTypeToString() string {
- hwtype, ok := iana.HwTypeToString[d.hwType]
- if !ok {
- hwtype = "Invalid"
- }
- return hwtype
+ return d.hwType.String()
}
// SetHwType returns the hardware type as defined by IANA.
diff --git a/dhcpv4/option_archtype.go b/dhcpv4/option_archtype.go
index 8eafc55..92a3769 100644
--- a/dhcpv4/option_archtype.go
+++ b/dhcpv4/option_archtype.go
@@ -42,8 +42,7 @@ func (o *OptClientArchType) Length() int {
func (o *OptClientArchType) String() string {
var archTypes string
for idx, at := range o.ArchTypes {
- name := iana.ArchTypeToString(at)
- archTypes += name
+ archTypes += at.String()
if idx < len(o.ArchTypes)-1 {
archTypes += ", "
}