Pull request: all: update backend tools and dependencies

Merge in DNS/adguard-home from 2275-update-tools to master

Squashed commit of the following:

commit 4de1cf91dc7accabeb2103d3c8ec424bee2a89ce
Merge: 06b302c62 62a8fe0b7
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Nov 19 16:22:30 2020 +0300

    Merge branch 'master' into 2275-update-tools

commit 06b302c62958aa8ab4a9da423a32cd71037d58d7
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Nov 13 11:29:19 2020 +0300

    all: update backend tools and dependencies
This commit is contained in:
Ainar Garipov
2020-11-20 13:44:21 +03:00
parent 62a8fe0b73
commit 642dcd647c
4 changed files with 303 additions and 43 deletions

View File

@@ -11,9 +11,9 @@ import (
"time"
"github.com/AdguardTeam/golibs/log"
"github.com/go-ping/ping"
"github.com/insomniacslk/dhcp/dhcpv4"
"github.com/insomniacslk/dhcp/dhcpv4/server4"
"github.com/sparrc/go-ping"
)
// v4Server - DHCPv4 server
@@ -244,6 +244,7 @@ func (s *v4Server) addrAvailable(target net.IP) bool {
pinger, err := ping.NewPinger(target.String())
if err != nil {
log.Error("ping.NewPinger(): %v", err)
return true
}
@@ -255,7 +256,12 @@ func (s *v4Server) addrAvailable(target net.IP) bool {
reply = true
}
log.Debug("dhcpv4: Sending ICMP Echo to %v", target)
pinger.Run()
err = pinger.Run()
if err != nil {
log.Error("pinger.Run(): %v", err)
return true
}
if reply {
log.Info("dhcpv4: IP conflict: %v is already used by another device", target)