diff --git a/internal/aghnet/net_internal_test.go b/internal/aghnet/net_internal_test.go index 9c4cff8c..8c5d9c8e 100644 --- a/internal/aghnet/net_internal_test.go +++ b/internal/aghnet/net_internal_test.go @@ -7,7 +7,6 @@ import ( "io/fs" "net" "net/netip" - "os" "strings" "testing" @@ -18,9 +17,6 @@ import ( "github.com/stretchr/testify/require" ) -// testdata is the filesystem containing data for testing the package. -var testdata fs.FS = os.DirFS("./testdata") - // substRootDirFS replaces the aghos.RootDirFS function used throughout the // package with fsys for tests ran under t. func substRootDirFS(t testing.TB, fsys fs.FS) { diff --git a/internal/aghnet/arpdb.go b/internal/arpdb/arpdb.go similarity index 62% rename from internal/aghnet/arpdb.go rename to internal/arpdb/arpdb.go index 44e96809..ebb11011 100644 --- a/internal/aghnet/arpdb.go +++ b/internal/arpdb/arpdb.go @@ -1,4 +1,5 @@ -package aghnet +// Package arpdb implements the Network Neighborhood Database. +package arpdb import ( "bufio" @@ -8,15 +9,25 @@ import ( "net/netip" "sync" + "github.com/AdguardTeam/AdGuardHome/internal/aghos" "github.com/AdguardTeam/golibs/errors" + "github.com/AdguardTeam/golibs/log" + "github.com/AdguardTeam/golibs/netutil" "golang.org/x/exp/slices" ) -// ARPDB: The Network Neighborhood Database +// Variables and functions to substitute in tests. +var ( + // aghosRunCommand is the function to run shell commands. + aghosRunCommand = aghos.RunCommand -// ARPDB stores and refreshes the network neighborhood reported by ARP (Address -// Resolution Protocol). -type ARPDB interface { + // rootDirFS is the filesystem pointing to the root directory. + rootDirFS = aghos.RootDirFS() +) + +// Interface stores and refreshes the network neighborhood reported by ARP +// (Address Resolution Protocol). +type Interface interface { // Refresh updates the stored data. It must be safe for concurrent use. Refresh() (err error) @@ -25,28 +36,24 @@ type ARPDB interface { Neighbors() (ns []Neighbor) } -// NewARPDB returns the ARPDB properly initialized for the OS. -func NewARPDB() (arp ARPDB) { +// New returns the [Interface] properly initialized for the OS. +func New() (arp Interface) { return newARPDB() } -// Empty ARPDB implementation - -// EmptyARPDB is the ARPDB implementation that does nothing. -type EmptyARPDB struct{} +// Empty is the [Interface] implementation that does nothing. +type Empty struct{} // type check -var _ ARPDB = EmptyARPDB{} +var _ Interface = Empty{} -// Refresh implements the ARPDB interface for EmptyARPContainer. It does +// Refresh implements the [Interface] interface for EmptyARPContainer. It does // nothing and always returns nil error. -func (EmptyARPDB) Refresh() (err error) { return nil } +func (Empty) Refresh() (err error) { return nil } -// Neighbors implements the ARPDB interface for EmptyARPContainer. It always -// returns nil. -func (EmptyARPDB) Neighbors() (ns []Neighbor) { return nil } - -// ARPDB Helper Types +// Neighbors implements the [Interface] interface for EmptyARPContainer. It +// always returns nil. +func (Empty) Neighbors() (ns []Neighbor) { return nil } // Neighbor is the pair of IP address and MAC address reported by ARP. type Neighbor struct { @@ -70,8 +77,21 @@ func (n Neighbor) Clone() (clone Neighbor) { } } +// validatedHostname returns valid hostname. Otherwise returns empty string and +// logs the error if hostname is not valid. +func validatedHostname(h string) (host string) { + err := netutil.ValidateHostname(h) + if err != nil { + log.Debug("arpdb: parsing arp output: host: %s", err) + + return "" + } + + return h +} + // neighs is the helper type that stores neighbors to avoid copying its methods -// among all the ARPDB implementations. +// among all the [Interface] implementations. type neighs struct { mu *sync.RWMutex ns []Neighbor @@ -108,14 +128,12 @@ func (ns *neighs) reset(with []Neighbor) { ns.ns = with } -// Command ARPDB - // parseNeighsFunc parses the text from sc as if it'd be an output of some // ARP-related command. lenHint is a hint for the size of the allocated slice // of Neighbors. type parseNeighsFunc func(sc *bufio.Scanner, lenHint int) (ns []Neighbor) -// cmdARPDB is the implementation of the ARPDB that uses command line to +// cmdARPDB is the implementation of the [Interface] that uses command line to // retrieve data. type cmdARPDB struct { parse parseNeighsFunc @@ -125,9 +143,9 @@ type cmdARPDB struct { } // type check -var _ ARPDB = (*cmdARPDB)(nil) +var _ Interface = (*cmdARPDB)(nil) -// Refresh implements the ARPDB interface for *cmdARPDB. +// Refresh implements the [Interface] interface for *cmdARPDB. func (arp *cmdARPDB) Refresh() (err error) { defer func() { err = errors.Annotate(err, "cmd arpdb: %w") }() @@ -150,24 +168,22 @@ func (arp *cmdARPDB) Refresh() (err error) { return nil } -// Neighbors implements the ARPDB interface for *cmdARPDB. +// Neighbors implements the [Interface] interface for *cmdARPDB. func (arp *cmdARPDB) Neighbors() (ns []Neighbor) { return arp.ns.clone() } -// Composite ARPDB - -// arpdbs is the ARPDB that combines several ARPDB implementations and -// consequently switches between those. +// arpdbs is the [Interface] that combines several [Interface] implementations +// and consequently switches between those. type arpdbs struct { - // arps is the set of ARPDB implementations to range through. - arps []ARPDB + // arps is the set of [Interface] implementations to range through. + arps []Interface neighs } // newARPDBs returns a properly initialized *arpdbs. It begins refreshing from // the first of arps. -func newARPDBs(arps ...ARPDB) (arp *arpdbs) { +func newARPDBs(arps ...Interface) (arp *arpdbs) { return &arpdbs{ arps: arps, neighs: neighs{ @@ -178,9 +194,9 @@ func newARPDBs(arps ...ARPDB) (arp *arpdbs) { } // type check -var _ ARPDB = (*arpdbs)(nil) +var _ Interface = (*arpdbs)(nil) -// Refresh implements the ARPDB interface for *arpdbs. +// Refresh implements the [Interface] interface for *arpdbs. func (arp *arpdbs) Refresh() (err error) { var errs []error @@ -200,7 +216,7 @@ func (arp *arpdbs) Refresh() (err error) { return errors.Annotate(errors.Join(errs...), "each arpdb failed: %w") } -// Neighbors implements the ARPDB interface for *arpdbs. +// Neighbors implements the [Interface] interface for *arpdbs. // // TODO(e.burkov): Think of a way to avoid cloning the slice twice. func (arp *arpdbs) Neighbors() (ns []Neighbor) { diff --git a/internal/aghnet/arpdb_bsd.go b/internal/arpdb/arpdb_bsd.go similarity index 74% rename from internal/aghnet/arpdb_bsd.go rename to internal/arpdb/arpdb_bsd.go index 50287785..c9658dbb 100644 --- a/internal/aghnet/arpdb_bsd.go +++ b/internal/arpdb/arpdb_bsd.go @@ -1,6 +1,6 @@ //go:build darwin || freebsd -package aghnet +package arpdb import ( "bufio" @@ -10,7 +10,6 @@ import ( "sync" "github.com/AdguardTeam/golibs/log" - "github.com/AdguardTeam/golibs/netutil" ) func newARPDB() (arp *cmdARPDB) { @@ -44,16 +43,16 @@ func parseArpA(sc *bufio.Scanner, lenHint int) (ns []Neighbor) { continue } - n := Neighbor{} - - if ipStr := fields[1]; len(ipStr) < 2 { + ipStr := fields[1] + if len(ipStr) < 2 { continue - } else if ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]); err != nil { + } + + ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]) + if err != nil { log.Debug("arpdb: parsing arp output: ip: %s", err) continue - } else { - n.IP = ip } hwStr := fields[3] @@ -62,19 +61,13 @@ func parseArpA(sc *bufio.Scanner, lenHint int) (ns []Neighbor) { log.Debug("arpdb: parsing arp output: mac: %s", err) continue - } else { - n.MAC = mac } - host := fields[0] - err = netutil.ValidateHostname(host) - if err != nil { - log.Debug("arpdb: parsing arp output: host: %s", err) - } else { - n.Name = host - } - - ns = append(ns, n) + ns = append(ns, Neighbor{ + IP: ip, + MAC: mac, + Name: validatedHostname(fields[0]), + }) } return ns diff --git a/internal/aghnet/arpdb_bsd_test.go b/internal/arpdb/arpdb_bsd_internal_test.go similarity index 98% rename from internal/aghnet/arpdb_bsd_test.go rename to internal/arpdb/arpdb_bsd_internal_test.go index b6bd6b9d..c8fc8e79 100644 --- a/internal/aghnet/arpdb_bsd_test.go +++ b/internal/arpdb/arpdb_bsd_internal_test.go @@ -1,6 +1,6 @@ //go:build darwin || freebsd -package aghnet +package arpdb import ( "net" diff --git a/internal/aghnet/arpdb_test.go b/internal/arpdb/arpdb_internal_test.go similarity index 70% rename from internal/aghnet/arpdb_test.go rename to internal/arpdb/arpdb_internal_test.go index 9ad6cd7d..dfd57614 100644 --- a/internal/aghnet/arpdb_test.go +++ b/internal/arpdb/arpdb_internal_test.go @@ -1,8 +1,12 @@ -package aghnet +package arpdb import ( + "fmt" + "io/fs" "net" "net/netip" + "os" + "strings" "sync" "testing" @@ -12,30 +16,78 @@ import ( "github.com/stretchr/testify/require" ) -func TestNewARPDB(t *testing.T) { - var a ARPDB - require.NotPanics(t, func() { a = NewARPDB() }) +// testdata is the filesystem containing data for testing the package. +var testdata fs.FS = os.DirFS("./testdata") + +// RunCmdFunc is the signature of aghos.RunCommand function. +type RunCmdFunc func(cmd string, args ...string) (code int, out []byte, err error) + +// substShell replaces the the aghos.RunCommand function used throughout the +// package with rc for tests ran under t. +func substShell(t testing.TB, rc RunCmdFunc) { + t.Helper() + + prev := aghosRunCommand + t.Cleanup(func() { aghosRunCommand = prev }) + aghosRunCommand = rc +} + +// mapShell is a substitution of aghos.RunCommand that maps the command to it's +// execution result. It's only needed to simplify testing. +// +// TODO(e.burkov): Perhaps put all the shell interactions behind an interface. +type mapShell map[string]struct { + err error + out string + code int +} + +// theOnlyCmd returns mapShell that only handles a single command and arguments +// combination from cmd. +func theOnlyCmd(cmd string, code int, out string, err error) (s mapShell) { + return mapShell{cmd: {code: code, out: out, err: err}} +} + +// RunCmd is a RunCmdFunc handled by s. +func (s mapShell) RunCmd(cmd string, args ...string) (code int, out []byte, err error) { + key := strings.Join(append([]string{cmd}, args...), " ") + ret, ok := s[key] + if !ok { + return 0, nil, fmt.Errorf("unexpected shell command %q", key) + } + + return ret.code, []byte(ret.out), ret.err +} + +func Test_New(t *testing.T) { + var a Interface + require.NotPanics(t, func() { a = New() }) assert.NotNil(t, a) } -// TestARPDB is the mock implementation of ARPDB to use in tests. +// TODO(s.chzhen): Consider moving mocks into aghtest. + +// TestARPDB is the mock implementation of [Interface] to use in tests. type TestARPDB struct { OnRefresh func() (err error) OnNeighbors func() (ns []Neighbor) } -// Refresh implements the ARPDB interface for *TestARPDB. +// type check +var _ Interface = (*TestARPDB)(nil) + +// Refresh implements the [Interface] interface for *TestARPDB. func (arp *TestARPDB) Refresh() (err error) { return arp.OnRefresh() } -// Neighbors implements the ARPDB interface for *TestARPDB. +// Neighbors implements the [Interface] interface for *TestARPDB. func (arp *TestARPDB) Neighbors() (ns []Neighbor) { return arp.OnNeighbors() } -func TestARPDBS(t *testing.T) { +func Test_NewARPDBs(t *testing.T) { knownIP := netip.MustParseAddr("1.2.3.4") knownMAC := net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF} @@ -195,7 +247,7 @@ func TestCmdARPDB_arpa(t *testing.T) { } func TestEmptyARPDB(t *testing.T) { - a := EmptyARPDB{} + a := Empty{} t.Run("refresh", func(t *testing.T) { var err error diff --git a/internal/aghnet/arpdb_linux.go b/internal/arpdb/arpdb_linux.go similarity index 78% rename from internal/aghnet/arpdb_linux.go rename to internal/arpdb/arpdb_linux.go index d3ebe4a7..0cf7f0ef 100644 --- a/internal/aghnet/arpdb_linux.go +++ b/internal/arpdb/arpdb_linux.go @@ -1,6 +1,6 @@ //go:build linux -package aghnet +package arpdb import ( "bufio" @@ -13,7 +13,6 @@ import ( "github.com/AdguardTeam/AdGuardHome/internal/aghos" "github.com/AdguardTeam/golibs/log" - "github.com/AdguardTeam/golibs/netutil" "github.com/AdguardTeam/golibs/stringutil" ) @@ -68,9 +67,9 @@ type fsysARPDB struct { } // type check -var _ ARPDB = (*fsysARPDB)(nil) +var _ Interface = (*fsysARPDB)(nil) -// Refresh implements the ARPDB interface for *fsysARPDB. +// Refresh implements the [Interface] interface for *fsysARPDB. func (arp *fsysARPDB) Refresh() (err error) { var f fs.File f, err = arp.fsys.Open(arp.filename) @@ -88,21 +87,10 @@ func (arp *fsysARPDB) Refresh() (err error) { ns := make([]Neighbor, 0, arp.ns.len()) for sc.Scan() { - ln := sc.Text() - fields := stringutil.SplitTrimmed(ln, " ") - if len(fields) != 6 { - continue + n := parseNeighbor(sc.Text()) + if n != nil { + ns = append(ns, *n) } - - n := Neighbor{} - n.IP, err = netip.ParseAddr(fields[0]) - if err != nil || n.IP.IsUnspecified() { - continue - } else if n.MAC, err = net.ParseMAC(fields[3]); err != nil { - continue - } - - ns = append(ns, n) } arp.ns.reset(ns) @@ -110,7 +98,30 @@ func (arp *fsysARPDB) Refresh() (err error) { return nil } -// Neighbors implements the ARPDB interface for *fsysARPDB. +// parseNeighbor parses line into *Neighbor. +func parseNeighbor(line string) (n *Neighbor) { + fields := stringutil.SplitTrimmed(line, " ") + if len(fields) != 6 { + return nil + } + + ip, err := netip.ParseAddr(fields[0]) + if err != nil || ip.IsUnspecified() { + return nil + } + + mac, err := net.ParseMAC(fields[3]) + if err != nil { + return nil + } + + return &Neighbor{ + IP: ip, + MAC: mac, + } +} + +// Neighbors implements the [Interface] interface for *fsysARPDB. func (arp *fsysARPDB) Neighbors() (ns []Neighbor) { return arp.ns.clone() } @@ -135,15 +146,11 @@ func parseArpAWrt(sc *bufio.Scanner, lenHint int) (ns []Neighbor) { continue } - n := Neighbor{} - ip, err := netip.ParseAddr(fields[0]) - if err != nil || n.IP.IsUnspecified() { + if err != nil { log.Debug("arpdb: parsing arp output: ip: %s", err) continue - } else { - n.IP = ip } hwStr := fields[3] @@ -152,11 +159,12 @@ func parseArpAWrt(sc *bufio.Scanner, lenHint int) (ns []Neighbor) { log.Debug("arpdb: parsing arp output: mac: %s", err) continue - } else { - n.MAC = mac } - ns = append(ns, n) + ns = append(ns, Neighbor{ + IP: ip, + MAC: mac, + }) } return ns @@ -176,35 +184,31 @@ func parseArpA(sc *bufio.Scanner, lenHint int) (ns []Neighbor) { continue } - n := Neighbor{} - - if ipStr := fields[1]; len(ipStr) < 2 { + ipStr := fields[1] + if len(ipStr) < 2 { continue - } else if ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]); err != nil { + } + + ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]) + if err != nil { log.Debug("arpdb: parsing arp output: ip: %s", err) continue - } else { - n.IP = ip } hwStr := fields[3] - if mac, err := net.ParseMAC(hwStr); err != nil { + mac, err := net.ParseMAC(hwStr) + if err != nil { log.Debug("arpdb: parsing arp output: mac: %s", err) continue - } else { - n.MAC = mac } - host := fields[0] - if verr := netutil.ValidateHostname(host); verr != nil { - log.Debug("arpdb: parsing arp output: host: %s", verr) - } else { - n.Name = host - } - - ns = append(ns, n) + ns = append(ns, Neighbor{ + IP: ip, + MAC: mac, + Name: validatedHostname(fields[0]), + }) } return ns diff --git a/internal/aghnet/arpdb_linux_test.go b/internal/arpdb/arpdb_linux_internal_test.go similarity index 99% rename from internal/aghnet/arpdb_linux_test.go rename to internal/arpdb/arpdb_linux_internal_test.go index d07c654d..44c76843 100644 --- a/internal/aghnet/arpdb_linux_test.go +++ b/internal/arpdb/arpdb_linux_internal_test.go @@ -1,6 +1,6 @@ //go:build linux -package aghnet +package arpdb import ( "net" diff --git a/internal/aghnet/arpdb_openbsd.go b/internal/arpdb/arpdb_openbsd.go similarity index 98% rename from internal/aghnet/arpdb_openbsd.go rename to internal/arpdb/arpdb_openbsd.go index 2b356d06..7b60737b 100644 --- a/internal/aghnet/arpdb_openbsd.go +++ b/internal/arpdb/arpdb_openbsd.go @@ -1,6 +1,6 @@ //go:build openbsd -package aghnet +package arpdb import ( "bufio" diff --git a/internal/aghnet/arpdb_openbsd_test.go b/internal/arpdb/arpdb_openbsd_internal_test.go similarity index 97% rename from internal/aghnet/arpdb_openbsd_test.go rename to internal/arpdb/arpdb_openbsd_internal_test.go index a324ed9c..ae7d7a46 100644 --- a/internal/aghnet/arpdb_openbsd_test.go +++ b/internal/arpdb/arpdb_openbsd_internal_test.go @@ -1,6 +1,6 @@ //go:build openbsd -package aghnet +package arpdb import ( "net" diff --git a/internal/aghnet/arpdb_windows.go b/internal/arpdb/arpdb_windows.go similarity index 81% rename from internal/aghnet/arpdb_windows.go rename to internal/arpdb/arpdb_windows.go index ed4c8682..3b4bb725 100644 --- a/internal/aghnet/arpdb_windows.go +++ b/internal/arpdb/arpdb_windows.go @@ -1,6 +1,6 @@ //go:build windows -package aghnet +package arpdb import ( "bufio" @@ -8,6 +8,8 @@ import ( "net/netip" "strings" "sync" + + "github.com/AdguardTeam/golibs/log" ) func newARPDB() (arp *cmdARPDB) { @@ -42,23 +44,24 @@ func parseArpA(sc *bufio.Scanner, lenHint int) (ns []Neighbor) { continue } - n := Neighbor{} - ip, err := netip.ParseAddr(fields[0]) if err != nil { + log.Debug("arpdb: parsing arp output: ip: %s", err) + continue - } else { - n.IP = ip } mac, err := net.ParseMAC(fields[1]) if err != nil { + log.Debug("arpdb: parsing arp output: mac: %s", err) + continue - } else { - n.MAC = mac } - ns = append(ns, n) + ns = append(ns, Neighbor{ + IP: ip, + MAC: mac, + }) } return ns diff --git a/internal/aghnet/arpdb_windows_test.go b/internal/arpdb/arpdb_windows_internal_test.go similarity index 97% rename from internal/aghnet/arpdb_windows_test.go rename to internal/arpdb/arpdb_windows_internal_test.go index c3dcfe04..a909048c 100644 --- a/internal/aghnet/arpdb_windows_test.go +++ b/internal/arpdb/arpdb_windows_internal_test.go @@ -1,6 +1,6 @@ //go:build windows -package aghnet +package arpdb import ( "net" diff --git a/internal/aghnet/testdata/proc_net_arp b/internal/arpdb/testdata/proc_net_arp similarity index 100% rename from internal/aghnet/testdata/proc_net_arp rename to internal/arpdb/testdata/proc_net_arp diff --git a/internal/home/clients.go b/internal/home/clients.go index d11f46a9..06aec5c6 100644 --- a/internal/home/clients.go +++ b/internal/home/clients.go @@ -10,6 +10,7 @@ import ( "time" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" + "github.com/AdguardTeam/AdGuardHome/internal/arpdb" "github.com/AdguardTeam/AdGuardHome/internal/client" "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" @@ -65,8 +66,8 @@ type clientsContainer struct { // hosts database. etcHosts *aghnet.HostsContainer - // arpdb stores the neighbors retrieved from ARP. - arpdb aghnet.ARPDB + // arpDB stores the neighbors retrieved from ARP. + arpDB arpdb.Interface // lock protects all fields. // @@ -95,7 +96,7 @@ func (clients *clientsContainer) Init( objects []*clientObject, dhcpServer dhcpd.Interface, etcHosts *aghnet.HostsContainer, - arpdb aghnet.ARPDB, + arpDB arpdb.Interface, filteringConf *filtering.Config, ) (err error) { if clients.list != nil { @@ -110,7 +111,7 @@ func (clients *clientsContainer) Init( clients.dhcpServer = dhcpServer clients.etcHosts = etcHosts - clients.arpdb = arpdb + clients.arpDB = arpDB err = clients.addFromConfig(objects, filteringConf) if err != nil { // Don't wrap the error, because it's informative enough as is. @@ -164,7 +165,7 @@ func (clients *clientsContainer) Start() { // reloadARP reloads runtime clients from ARP, if configured. func (clients *clientsContainer) reloadARP() { - if clients.arpdb != nil { + if clients.arpDB != nil { clients.addFromSystemARP() } } @@ -877,15 +878,15 @@ func (clients *clientsContainer) addFromHostsFile(hosts aghnet.Hosts) { // addFromSystemARP adds the IP-hostname pairings from the output of the arp -a // command. func (clients *clientsContainer) addFromSystemARP() { - if err := clients.arpdb.Refresh(); err != nil { + if err := clients.arpDB.Refresh(); err != nil { log.Error("refreshing arp container: %s", err) - clients.arpdb = aghnet.EmptyARPDB{} + clients.arpDB = arpdb.Empty{} return } - ns := clients.arpdb.Neighbors() + ns := clients.arpDB.Neighbors() if len(ns) == 0 { log.Debug("refreshing arp container: the update is empty") diff --git a/internal/home/home.go b/internal/home/home.go index 19bb0ca4..b615a73b 100644 --- a/internal/home/home.go +++ b/internal/home/home.go @@ -22,6 +22,7 @@ import ( "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/AdguardTeam/AdGuardHome/internal/aghos" "github.com/AdguardTeam/AdGuardHome/internal/aghtls" + "github.com/AdguardTeam/AdGuardHome/internal/arpdb" "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" "github.com/AdguardTeam/AdGuardHome/internal/filtering" @@ -289,16 +290,16 @@ func initContextClients() (err error) { return fmt.Errorf("initing dhcp: %w", err) } - var arpdb aghnet.ARPDB + var arpDB arpdb.Interface if config.Clients.Sources.ARP { - arpdb = aghnet.NewARPDB() + arpDB = arpdb.New() } err = Context.clients.Init( config.Clients.Persistent, Context.dhcpServer, Context.etcHosts, - arpdb, + arpDB, config.DNS.DnsfilterConf, ) if err != nil { diff --git a/scripts/make/go-lint.sh b/scripts/make/go-lint.sh index 89006885..b883deff 100644 --- a/scripts/make/go-lint.sh +++ b/scripts/make/go-lint.sh @@ -191,6 +191,7 @@ gocognit_paths="\ ./internal/aghhttp/ 10 ./internal/aghio/ 10 ./internal/aghrenameio/ 10 +./internal/arpdb/ 10 ./internal/client/ 10 ./internal/dhcpsvc 10 ./internal/filtering/hashprefix/ 10