summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/dhcpv4.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4/dhcpv4.go')
-rw-r--r--dhcpv4/dhcpv4.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/dhcpv4/dhcpv4.go b/dhcpv4/dhcpv4.go
index 4dc05ad..fe5e54e 100644
--- a/dhcpv4/dhcpv4.go
+++ b/dhcpv4/dhcpv4.go
@@ -604,7 +604,8 @@ func (d *DHCPv4) DomainName() string {
//
// The Host Name option is described by RFC 2132, Section 3.14.
func (d *DHCPv4) HostName() string {
- return GetString(OptionHostName, d.Options)
+ name := GetString(OptionHostName, d.Options)
+ return strings.TrimRight(name, "\x00")
}
// RootPath parses the DHCPv4 Root Path option if present.