summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/dhcpv4.go
diff options
context:
space:
mode:
authorEugene Burkov <e.burkov@adguard.com>2021-03-10 15:58:10 +0300
committerChris K <c@chrisko.ch>2021-03-10 11:37:51 -0800
commitcfd4d47082c2e1d6e1204346d879174578ceac3d (patch)
tree0f569314be9f968f674a87298e505853fc9f8b78 /dhcpv4/dhcpv4.go
parent018caddcb1ebc9c36a656d0186e4c28ec6af8a33 (diff)
Improve ipv4 compatibility
Signed-off-by: Eugene Burkov <e.burkov@adguard.com>
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.