summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/option_generic.go
diff options
context:
space:
mode:
authorinsomniac <insomniacslk@users.noreply.github.com>2018-08-19 19:58:01 +0100
committerGitHub <noreply@github.com>2018-08-19 19:58:01 +0100
commitc0dc38b656ec84a401a99f2f97f6af79c4e66398 (patch)
tree11892b32733d2cee916f8236c5afe10f40bcbab2 /dhcpv4/option_generic.go
parentececa3f5129cbc0bca341ea87a14bfaa8576156d (diff)
Added String methods for types (#140)
* Added String methods for types * Reverted change on bsdp.OptionCode
Diffstat (limited to 'dhcpv4/option_generic.go')
-rw-r--r--dhcpv4/option_generic.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/dhcpv4/option_generic.go b/dhcpv4/option_generic.go
index 0cecfd6..4ff35f8 100644
--- a/dhcpv4/option_generic.go
+++ b/dhcpv4/option_generic.go
@@ -52,11 +52,7 @@ func (o OptionGeneric) ToBytes() []byte {
// String returns a human-readable representation of a generic option.
func (o OptionGeneric) String() string {
- code, ok := OptionCodeToString[o.OptionCode]
- if !ok {
- code = "Unknown"
- }
- return fmt.Sprintf("%v -> %v", code, o.Data)
+ return fmt.Sprintf("%v -> %v", o.OptionCode.String(), o.Data)
}
// Length returns the number of bytes comprising the data section of the option.