"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "internal/dhcpd/v4.go" between
AdGuardHome-0.105.1.tar.gz and AdGuardHome-0.105.2.tar.gz

About: AdGuard Home is a network-wide ads & trackers blocking DNS server. It operates as a DNS server that re-routes tracking domains to a "black hole," thus preventing your devices from connecting to those servers.

v4.go  (AdGuardHome-0.105.1):v4.go  (AdGuardHome-0.105.2)
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
package dhcpd package dhcpd
import ( import (
"bytes" "bytes"
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"net" "net"
"strings"
"sync" "sync"
"time" "time"
"github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/log"
"github.com/go-ping/ping" "github.com/go-ping/ping"
"github.com/insomniacslk/dhcp/dhcpv4" "github.com/insomniacslk/dhcp/dhcpv4"
"github.com/insomniacslk/dhcp/dhcpv4/server4" "github.com/insomniacslk/dhcp/dhcpv4/server4"
) )
// v4Server is a DHCPv4 server. // v4Server is a DHCPv4 server.
skipping to change at line 466 skipping to change at line 467
} }
} }
s.leasesLock.Unlock() s.leasesLock.Unlock()
if lease == nil { if lease == nil {
log.Debug("dhcpv4: No lease for %s", mac) log.Debug("dhcpv4: No lease for %s", mac)
return nil, true return nil, true
} }
if lease.Expiry.Unix() != leaseExpireStatic { if lease.Expiry.Unix() != leaseExpireStatic {
lease.Hostname = string(hostname) // The trimming is required since some devices include trailing
// zero-byte in DHCP option length calculation.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/2582.
//
// TODO(e.burkov): Remove after the trimming for hostname option
// will be added into github.com/insomniacslk/dhcp module.
hostnameStr := strings.TrimRight(string(hostname), "\x00")
lease.Hostname = hostnameStr
s.commitLease(lease) s.commitLease(lease)
} else if len(lease.Hostname) != 0 { } else if len(lease.Hostname) != 0 {
o := &optFQDN{ o := &optFQDN{
name: lease.Hostname, name: lease.Hostname,
} }
fqdn := dhcpv4.Option{ fqdn := dhcpv4.Option{
Code: dhcpv4.OptionFQDN, Code: dhcpv4.OptionFQDN,
Value: o, Value: o,
} }
resp.UpdateOption(fqdn) resp.UpdateOption(fqdn)
 End of changes. 2 change blocks. 
1 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)