From d1580182db3b5866213e017405aa2cf8a6ee2f24 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Wed, 17 Mar 2021 14:51:43 +0300 Subject: [PATCH] all: doc changes; imp naming --- CHANGELOG.md | 10 ++++++---- internal/dhcpd/v4.go | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 266e09c0de8..13688bbba26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,18 +27,20 @@ and this project adheres to - Go 1.15 support. v0.107.0 will require at least Go 1.16 to build. -### Removed - -- Go 1.14 support. - ### Fixed +- Support for more than one `/24` subnet in DHCP ([#2541]). - Invalid filenames in the `mobileconfig` API responses ([#2835]). +### Removed + +- Go 1.14 support. + [#2385]: https://github.com/AdguardTeam/AdGuardHome/issues/2385 [#2412]: https://github.com/AdguardTeam/AdGuardHome/issues/2412 [#2498]: https://github.com/AdguardTeam/AdGuardHome/issues/2498 [#2533]: https://github.com/AdguardTeam/AdGuardHome/issues/2533 +[#2541]: https://github.com/AdguardTeam/AdGuardHome/issues/2541 [#2835]: https://github.com/AdguardTeam/AdGuardHome/issues/2835 diff --git a/internal/dhcpd/v4.go b/internal/dhcpd/v4.go index b5d01644d68..7bb42fb975c 100644 --- a/internal/dhcpd/v4.go +++ b/internal/dhcpd/v4.go @@ -111,10 +111,12 @@ func (s *v4Server) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } +// defaultHwAddrLen is the default length of a hardware (MAC) address. +const defaultHwAddrLen = 6 + // Add the specified IP to the black list for a time period -func (s *v4Server) blacklistLease(l *Lease) { - hw := make(net.HardwareAddr, 6) - l.HWAddr = hw +func (s *v4Server) blocklistLease(l *Lease) { + l.HWAddr = make(net.HardwareAddr, defaultHwAddrLen) l.Hostname = "" l.Expiry = time.Now().Add(s.conf.leaseTime) } @@ -393,7 +395,7 @@ func (s *v4Server) processDiscover(req, resp *dhcpv4.DHCPv4) *Lease { toStore = true if !s.addrAvailable(lease.IP) { - s.blacklistLease(lease) + s.blocklistLease(lease) lease = nil continue }