Skip to content

Commit

Permalink
all: doc changes; imp naming
Browse files Browse the repository at this point in the history
  • Loading branch information
ainar-g committed Mar 17, 2021
1 parent f036b50 commit d158018
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
10 changes: 6 additions & 4 deletions internal/dhcpd/v4.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit d158018

Please sign in to comment.