docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> } <mask> <mask> set.Add(h) <mask> <mask> rule, rulePtr := hp.writeRules(h, ip) <mask> hp.translations[rule], hp.translations[rulePtr] = processed, processed <mask> <mask> log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, h) <mask> } <mask> } <mask> <mask> // writeRules writes the actual rule for the qtype and the PTR for the host-ip <mask> // pair into internal builders. </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> add // addRules adds rules and rule translations for the line. func (hp *hostsParser) addRules(ip net.IP, host, line string) { rule, rulePtr := hp.writeRules(host, ip) hp.translations[rule], hp.translations[rulePtr] = line, line log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, host) } </s> remove set.Add(h) </s> add rec.Aliases.Add(host) </s> remove var set *stringutil.Set set, ok = v.(*stringutil.Set) </s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases) } // addRecord puts the record for the IP address to the rules builder if needed. // The first host is considered to be the canonical name for the IP address. // hosts must have at least one name. func (hp *hostsParser) addRecord(ip net.IP, hosts []string) { line := strings.Join(append([]string{ip.String()}, hosts...), " ") var rec *HostsRecord v, ok := hp.table.Get(ip) </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For // each ip the first member of hosts will become the main one. func (hp *hostsParser) addPairs(ip net.IP, hosts []string) { v, ok := hp.table.Get(ip) if !ok { // This ip is added at the first time. v = stringutil.NewSet() hp.table.Set(ip, v) </s> add // HostsRecord represents a single hosts file record. type HostsRecord struct { Aliases *stringutil.Set Canonical string } // Equal returns true if all fields of rec are equal to field in other or they // both are nil. func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) { if rec == nil { return other == nil </s> remove log.Debug("clients: added %d client aliases from system hosts-file", n) </s> add log.Debug("clients: added %d client aliases from system hosts file", n) </s> remove // Return true if every value from the IP map has no discrepancies with the // appropriate one from the target. return !ok </s> add return ok
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer.go
keep add keep keep keep keep keep keep
<mask> } <mask> <mask> // writeRules writes the actual rule for the qtype and the PTR for the host-ip <mask> // pair into internal builders. <mask> func (hp *hostsParser) writeRules(host string, ip net.IP) (rule, rulePtr string) { <mask> arpa, err := netutil.IPToReversedAddr(ip) <mask> if err != nil { <mask> return "", "" </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove rule, rulePtr := hp.writeRules(h, ip) hp.translations[rule], hp.translations[rulePtr] = processed, processed log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, h) </s> add hp.addRules(ip, host, line) </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For // each ip the first member of hosts will become the main one. func (hp *hostsParser) addPairs(ip net.IP, hosts []string) { v, ok := hp.table.Get(ip) if !ok { // This ip is added at the first time. v = stringutil.NewSet() hp.table.Set(ip, v) </s> add // HostsRecord represents a single hosts file record. type HostsRecord struct { Aliases *stringutil.Set Canonical string } // Equal returns true if all fields of rec are equal to field in other or they // both are nil. func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) { if rec == nil { return other == nil </s> remove var set *stringutil.Set set, ok = v.(*stringutil.Set) </s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases) } // addRecord puts the record for the IP address to the rules builder if needed. // The first host is considered to be the canonical name for the IP address. // hosts must have at least one name. func (hp *hostsParser) addRecord(ip net.IP, hosts []string) { line := strings.Join(append([]string{ip.String()}, hosts...), " ") var rec *HostsRecord v, ok := hp.table.Get(ip) </s> add // target's values must be of type *HostsRecord. </s> remove // defined by refreshIvl. It disables auto-resfreshing if refreshIvl is 0. If </s> add // defined by refreshIvl. It disables auto-refreshing if refreshIvl is 0. If </s> remove // Return true if every value from the IP map has no discrepancies with the // appropriate one from the target. return !ok </s> add return ok
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer.go
keep keep add keep keep keep keep
<mask> } <mask> <mask> // equalSet returns true if the internal hosts table just parsed equals target. <mask> func (hp *hostsParser) equalSet(target *netutil.IPMap) (ok bool) { <mask> if target == nil { <mask> // hp.table shouldn't appear nil since it's initialized on each refresh. <mask> return target == hp.table </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For // each ip the first member of hosts will become the main one. func (hp *hostsParser) addPairs(ip net.IP, hosts []string) { v, ok := hp.table.Get(ip) if !ok { // This ip is added at the first time. v = stringutil.NewSet() hp.table.Set(ip, v) </s> add // HostsRecord represents a single hosts file record. type HostsRecord struct { Aliases *stringutil.Set Canonical string } // Equal returns true if all fields of rec are equal to field in other or they // both are nil. func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) { if rec == nil { return other == nil </s> remove // Return true if every value from the IP map has no discrepancies with the // appropriate one from the target. return !ok </s> add return ok </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) { // ok is set to true if the target doesn't contain ip or if the // appropriate hosts set isn't equal to the checked one. if a, hasIP := target.Get(ip); !hasIP { ok = true } else if hosts, aok := a.(*stringutil.Set); aok { ok = !hosts.Equal(b.(*stringutil.Set)) </s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) { var targetVal interface{} targetVal, ok = target.Get(ip) if !ok { return false </s> add // addRules adds rules and rule translations for the line. func (hp *hostsParser) addRules(ip net.IP, host, line string) { rule, rulePtr := hp.writeRules(host, ip) hp.translations[rule], hp.translations[rulePtr] = line, line log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, host) } </s> remove hp.addPairs(ip, hosts) </s> add hp.addRecord(ip, hosts) </s> remove var set *stringutil.Set set, ok = v.(*stringutil.Set) </s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases) } // addRecord puts the record for the IP address to the rules builder if needed. // The first host is considered to be the canonical name for the IP address. // hosts must have at least one name. func (hp *hostsParser) addRecord(ip net.IP, hosts []string) { line := strings.Join(append([]string{ip.String()}, hosts...), " ") var rec *HostsRecord v, ok := hp.table.Get(ip)
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer.go
keep keep keep keep replace replace replace replace replace replace replace keep keep replace replace
<mask> if hp.table.Len() != target.Len() { <mask> return false <mask> } <mask> <mask> hp.table.Range(func(ip net.IP, b interface{}) (cont bool) { <mask> // ok is set to true if the target doesn't contain ip or if the <mask> // appropriate hosts set isn't equal to the checked one. <mask> if a, hasIP := target.Get(ip); !hasIP { <mask> ok = true <mask> } else if hosts, aok := a.(*stringutil.Set); aok { <mask> ok = !hosts.Equal(b.(*stringutil.Set)) <mask> } <mask> <mask> // Continue only if maps has no discrepancies. <mask> return !ok </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove // Return true if every value from the IP map has no discrepancies with the // appropriate one from the target. return !ok </s> add return ok </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For // each ip the first member of hosts will become the main one. func (hp *hostsParser) addPairs(ip net.IP, hosts []string) { v, ok := hp.table.Get(ip) if !ok { // This ip is added at the first time. v = stringutil.NewSet() hp.table.Set(ip, v) </s> add // HostsRecord represents a single hosts file record. type HostsRecord struct { Aliases *stringutil.Set Canonical string } // Equal returns true if all fields of rec are equal to field in other or they // both are nil. func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) { if rec == nil { return other == nil </s> remove var set *stringutil.Set set, ok = v.(*stringutil.Set) </s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases) } // addRecord puts the record for the IP address to the rules builder if needed. // The first host is considered to be the canonical name for the IP address. // hosts must have at least one name. func (hp *hostsParser) addRecord(ip net.IP, hosts []string) { line := strings.Join(append([]string{ip.String()}, hosts...), " ") var rec *HostsRecord v, ok := hp.table.Get(ip) </s> remove hosts, ok := v.(*stringutil.Set) </s> add rec, ok := v.(*aghnet.HostsRecord) </s> remove var rc *RuntimeClient rc, ok = clients.findRuntimeClientLocked(ip) </s> add rc, ok := clients.findRuntimeClientLocked(ip)
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> // Continue only if maps has no discrepancies. <mask> return !ok <mask> }) <mask> <mask> // Return true if every value from the IP map has no discrepancies with the <mask> // appropriate one from the target. <mask> return !ok <mask> } <mask> <mask> // sendUpd tries to send the parsed data to the ch. <mask> func (hp *hostsParser) sendUpd(ch chan *netutil.IPMap) { <mask> log.Debug("%s: sending upd", hostsContainerPref) </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove // Continue only if maps has no discrepancies. return !ok </s> add var rec *HostsRecord rec, ok = recVal.(*HostsRecord) if !ok { log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal) return false } var targetRec *HostsRecord targetRec, ok = targetVal.(*HostsRecord) if !ok { log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal) return false } ok = rec.Equal(targetRec) return ok </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) { // ok is set to true if the target doesn't contain ip or if the // appropriate hosts set isn't equal to the checked one. if a, hasIP := target.Get(ip); !hasIP { ok = true } else if hosts, aok := a.(*stringutil.Set); aok { ok = !hosts.Equal(b.(*stringutil.Set)) </s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) { var targetVal interface{} targetVal, ok = target.Get(ip) if !ok { return false </s> remove var set *stringutil.Set set, ok = v.(*stringutil.Set) </s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases) } // addRecord puts the record for the IP address to the rules builder if needed. // The first host is considered to be the canonical name for the IP address. // hosts must have at least one name. func (hp *hostsParser) addRecord(ip net.IP, hosts []string) { line := strings.Join(append([]string{ip.String()}, hosts...), " ") var rec *HostsRecord v, ok := hp.table.Get(ip) </s> remove log.Debug("clients: added %d client aliases from system hosts-file", n) </s> add log.Debug("clients: added %d client aliases from system hosts file", n) </s> add // target's values must be of type *HostsRecord. </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For // each ip the first member of hosts will become the main one. func (hp *hostsParser) addPairs(ip net.IP, hosts []string) { v, ok := hp.table.Get(ip) if !ok { // This ip is added at the first time. v = stringutil.NewSet() hp.table.Set(ip, v) </s> add // HostsRecord represents a single hosts file record. type HostsRecord struct { Aliases *stringutil.Set Canonical string } // Equal returns true if all fields of rec are equal to field in other or they // both are nil. func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) { if rec == nil { return other == nil
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer.go
keep keep keep add keep keep keep keep keep keep
<mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest" <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/stringutil" <mask> "github.com/AdguardTeam/golibs/testutil" <mask> "github.com/AdguardTeam/urlfilter" <mask> "github.com/AdguardTeam/urlfilter/rules" <mask> "github.com/miekg/dns" <mask> "github.com/stretchr/testify/assert" </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove log.Debug("clients: added %d client aliases from system hosts-file", n) </s> add log.Debug("clients: added %d client aliases from system hosts file", n) </s> remove hosts.Range(func(name string) (cont bool) { if clients.addHostLocked(ip, name, ClientSourceHostsFile) { n++ } return true }) </s> add clients.addHostLocked(ip, rec.Canonical, ClientSourceHostsFile) n++ </s> remove }, { </s> add name: "hello_alias", </s> remove Hostname: "simplehost", </s> add Hostname: "hello.world", </s> remove name: "simple", </s> add }, { </s> add req: &urlfilter.DNSRequest{ Hostname: "simplehost", DNSType: dns.TypeA, }, name: "simple",
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> hc, err := NewHostsContainer(0, testFS, w, "dir") <mask> require.NoError(t, err) <mask> testutil.CleanupAndRequireSuccess(t, hc.Close) <mask> <mask> checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) { <mask> upd, ok := <-hc.Upd() <mask> require.True(t, ok) <mask> require.NotNil(t, upd) <mask> <mask> assert.Equal(t, 1, upd.Len()) <mask> <mask> v, ok := upd.Get(ip) <mask> require.True(t, ok) </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove var set *stringutil.Set set, ok = v.(*stringutil.Set) require.True(t, ok) </s> add require.IsType(t, (*HostsRecord)(nil), v) </s> remove assert.True(t, set.Equal(wantHosts)) </s> add rec, _ := v.(*HostsRecord) require.NotNil(t, rec) assert.Truef(t, rec.Equal(want), "%+v != %+v", rec, want) </s> remove hosts, ok := v.(*stringutil.Set) </s> add rec, ok := v.(*aghnet.HostsRecord) </s> add name string want []*rules.DNSRewrite </s> remove var rc *RuntimeClient rc, ok = clients.findRuntimeClientLocked(ip) </s> add rc, ok := clients.findRuntimeClientLocked(ip) </s> remove want []*rules.DNSRewrite name string </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep replace replace replace keep replace keep keep
<mask> <mask> var set *stringutil.Set <mask> set, ok = v.(*stringutil.Set) <mask> require.True(t, ok) <mask> <mask> assert.True(t, set.Equal(wantHosts)) <mask> } <mask> </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove log.Debug("%s: adding pairs: unexpected value type %T", hostsContainerPref, v) </s> add rec = &HostsRecord{ Aliases: stringutil.NewSet(), } </s> remove checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) { upd, ok := <-hc.Upd() require.True(t, ok) require.NotNil(t, upd) </s> add checkRefresh := func(t *testing.T, want *HostsRecord) { t.Helper() var ok bool var upd *netutil.IPMap select { case upd, ok = <-hc.Upd(): require.True(t, ok) require.NotNil(t, upd) case <-time.After(1 * time.Second): t.Fatal("did not receive after 1s") } </s> remove var set *stringutil.Set set, ok = v.(*stringutil.Set) </s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases) } // addRecord puts the record for the IP address to the rules builder if needed. // The first host is considered to be the canonical name for the IP address. // hosts must have at least one name. func (hp *hostsParser) addRecord(ip net.IP, hosts []string) { line := strings.Join(append([]string{ip.String()}, hosts...), " ") var rec *HostsRecord v, ok := hp.table.Get(ip) </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For // each ip the first member of hosts will become the main one. func (hp *hostsParser) addPairs(ip net.IP, hosts []string) { v, ok := hp.table.Get(ip) if !ok { // This ip is added at the first time. v = stringutil.NewSet() hp.table.Set(ip, v) </s> add // HostsRecord represents a single hosts file record. type HostsRecord struct { Aliases *stringutil.Set Canonical string } // Equal returns true if all fields of rec are equal to field in other or they // both are nil. func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) { if rec == nil { return other == nil </s> remove checkRefresh(t, stringutil.NewSet("hostname")) </s> add checkRefresh(t, &HostsRecord{ Aliases: stringutil.NewSet(), Canonical: "hostname", })
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> assert.True(t, set.Equal(wantHosts)) <mask> } <mask> <mask> t.Run("initial_refresh", func(t *testing.T) { <mask> checkRefresh(t, stringutil.NewSet("hostname")) <mask> }) <mask> <mask> t.Run("second_refresh", func(t *testing.T) { <mask> testFS["dir/file2"] = &fstest.MapFile{Data: []byte(ipStr + ` alias` + nl)} <mask> eventsCh <- event{} </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove checkRefresh(t, stringutil.NewSet("hostname", "alias")) </s> add checkRefresh(t, &HostsRecord{ Aliases: stringutil.NewSet("alias"), Canonical: "hostname", }) </s> remove assert.True(t, set.Equal(wantHosts)) </s> add rec, _ := v.(*HostsRecord) require.NotNil(t, rec) assert.Truef(t, rec.Equal(want), "%+v != %+v", rec, want) </s> remove var set *stringutil.Set set, ok = v.(*stringutil.Set) require.True(t, ok) </s> add require.IsType(t, (*HostsRecord)(nil), v) </s> remove checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) { upd, ok := <-hc.Upd() require.True(t, ok) require.NotNil(t, upd) </s> add checkRefresh := func(t *testing.T, want *HostsRecord) { t.Helper() var ok bool var upd *netutil.IPMap select { case upd, ok = <-hc.Upd(): require.True(t, ok) require.NotNil(t, upd) case <-time.After(1 * time.Second): t.Fatal("did not receive after 1s") } </s> remove hosts.Range(func(name string) (cont bool) { if clients.addHostLocked(ip, name, ClientSourceHostsFile) { n++ } return true }) </s> add clients.addHostLocked(ip, rec.Canonical, ClientSourceHostsFile) n++ </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) { // ok is set to true if the target doesn't contain ip or if the // appropriate hosts set isn't equal to the checked one. if a, hasIP := target.Get(ip); !hasIP { ok = true } else if hosts, aok := a.(*stringutil.Set); aok { ok = !hosts.Equal(b.(*stringutil.Set)) </s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) { var targetVal interface{} targetVal, ok = target.Get(ip) if !ok { return false
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> t.Run("second_refresh", func(t *testing.T) { <mask> testFS["dir/file2"] = &fstest.MapFile{Data: []byte(ipStr + ` alias` + nl)} <mask> eventsCh <- event{} <mask> checkRefresh(t, stringutil.NewSet("hostname", "alias")) <mask> }) <mask> <mask> t.Run("double_refresh", func(t *testing.T) { <mask> // Make a change once. <mask> testFS["dir/file1"] = &fstest.MapFile{Data: []byte(ipStr + ` alias` + nl)} </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove checkRefresh(t, stringutil.NewSet("hostname")) </s> add checkRefresh(t, &HostsRecord{ Aliases: stringutil.NewSet(), Canonical: "hostname", }) </s> remove assert.True(t, set.Equal(wantHosts)) </s> add rec, _ := v.(*HostsRecord) require.NotNil(t, rec) assert.Truef(t, rec.Equal(want), "%+v != %+v", rec, want) </s> remove var set *stringutil.Set set, ok = v.(*stringutil.Set) require.True(t, ok) </s> add require.IsType(t, (*HostsRecord)(nil), v) </s> remove checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) { upd, ok := <-hc.Upd() require.True(t, ok) require.NotNil(t, upd) </s> add checkRefresh := func(t *testing.T, want *HostsRecord) { t.Helper() var ok bool var upd *netutil.IPMap select { case upd, ok = <-hc.Upd(): require.True(t, ok) require.NotNil(t, upd) case <-time.After(1 * time.Second): t.Fatal("did not receive after 1s") } </s> remove var rc *RuntimeClient rc, ok = clients.findRuntimeClientLocked(ip) </s> add rc, ok := clients.findRuntimeClientLocked(ip) </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) { // ok is set to true if the target doesn't contain ip or if the // appropriate hosts set isn't equal to the checked one. if a, hasIP := target.Get(ip); !hasIP { ok = true } else if hosts, aok := a.(*stringutil.Set); aok { ok = !hosts.Equal(b.(*stringutil.Set)) </s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) { var targetVal interface{} targetVal, ok = target.Get(ip) if !ok { return false
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> require.NoError(t, fstest.TestFS(testdata, "etc_hosts")) <mask> <mask> testCases := []struct { <mask> want []*rules.DNSRewrite <mask> name string <mask> req *urlfilter.DNSRequest <mask> }{{ <mask> want: []*rules.DNSRewrite{{ <mask> RCode: dns.RcodeSuccess, <mask> Value: net.IPv4(1, 0, 0, 1), </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> add name string want []*rules.DNSRewrite </s> add req: &urlfilter.DNSRequest{ Hostname: "simplehost", DNSType: dns.TypeA, }, name: "simple", </s> remove }, { </s> add name: "other_line_alias", </s> remove }, { </s> add name: "hello_alias", </s> add req: &urlfilter.DNSRequest{ Hostname: "for.testing", DNSType: dns.TypeA, }, name: "lots_of_aliases", </s> remove }, { </s> add name: "issue_4216_4",
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep add keep keep keep keep keep
<mask> require.NoError(t, fstest.TestFS(testdata, "etc_hosts")) <mask> <mask> testCases := []struct { <mask> req *urlfilter.DNSRequest <mask> }{{ <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "simplehost", <mask> DNSType: dns.TypeA, <mask> }, </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove want []*rules.DNSRewrite name string </s> add </s> add req: &urlfilter.DNSRequest{ Hostname: "simplehost", DNSType: dns.TypeA, }, name: "simple", </s> remove name: "simple", </s> add }, { </s> remove Hostname: "simplehost", </s> add Hostname: "hello.world", </s> remove }, { </s> add name: "hello_alias", </s> add name: "bad_type", want: nil,
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep add keep keep keep keep keep keep
<mask> req *urlfilter.DNSRequest <mask> name string <mask> want []*rules.DNSRewrite <mask> }{{ <mask> want: []*rules.DNSRewrite{{ <mask> RCode: dns.RcodeSuccess, <mask> Value: net.IPv4(1, 0, 0, 1), <mask> RRType: dns.TypeA, <mask> }, { <mask> RCode: dns.RcodeSuccess, </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove want []*rules.DNSRewrite name string </s> add </s> add name string want []*rules.DNSRewrite </s> remove }, { </s> add name: "other_line_alias", </s> remove }, { </s> add name: "hello_alias", </s> add req: &urlfilter.DNSRequest{ Hostname: "for.testing", DNSType: dns.TypeA, }, name: "lots_of_aliases", </s> remove }, { </s> add name: "issue_4216_4",
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep replace keep replace
<mask> }}, <mask> name: "simple", <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "simplehost", </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> add req: &urlfilter.DNSRequest{ Hostname: "simplehost", DNSType: dns.TypeA, }, name: "simple", </s> remove }, { </s> add name: "hello_alias", </s> remove name: "other_line_alias", req: &urlfilter.DNSRequest{ Hostname: "hello.world.again", DNSType: dns.TypeA, }, </s> add </s> remove name: "reverse", req: &urlfilter.DNSRequest{ Hostname: "1.0.0.1.in-addr.arpa", DNSType: dns.TypePTR, }, </s> add </s> add name string want []*rules.DNSRewrite
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "simplehost", <mask> DNSType: dns.TypeA, <mask> }, <mask> }, { <mask> want: []*rules.DNSRewrite{{ <mask> RCode: dns.RcodeSuccess, <mask> Value: net.IPv4(1, 0, 0, 0), <mask> RRType: dns.TypeA, <mask> }, { </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove }, { </s> add name: "other_line_alias", </s> add req: &urlfilter.DNSRequest{ Hostname: "simplehost", DNSType: dns.TypeA, }, name: "simple", </s> add req: &urlfilter.DNSRequest{ Hostname: "for.testing", DNSType: dns.TypeA, }, name: "lots_of_aliases", </s> remove Hostname: "simplehost", </s> add Hostname: "hello.world", </s> remove name: "simple", </s> add }, { </s> remove Hostname: "domain4", DNSType: dns.TypeA, </s> add Hostname: "domain6", DNSType: dns.TypeAAAA,
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace keep replace keep
<mask> RCode: dns.RcodeSuccess, <mask> Value: net.ParseIP("::"), <mask> RRType: dns.TypeAAAA, <mask> }}, <mask> name: "hello_alias", <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "hello.world", <mask> DNSType: dns.TypeA, </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove name: "other_line_alias", req: &urlfilter.DNSRequest{ Hostname: "hello.world.again", DNSType: dns.TypeA, }, </s> add </s> remove Hostname: "simplehost", </s> add Hostname: "hello.world", </s> remove Hostname: "domain4", DNSType: dns.TypeA, </s> add Hostname: "domain6", DNSType: dns.TypeAAAA, </s> remove name: "lots_of_aliases", </s> add }, { </s> remove name: "simple", </s> add }, {
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "hello.world", <mask> DNSType: dns.TypeA, <mask> }, <mask> }, { <mask> want: []*rules.DNSRewrite{{ <mask> RCode: dns.RcodeSuccess, <mask> Value: net.IPv4(1, 0, 0, 0), <mask> RRType: dns.TypeA, <mask> }, { </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove }, { </s> add name: "hello_alias", </s> add req: &urlfilter.DNSRequest{ Hostname: "for.testing", DNSType: dns.TypeA, }, name: "lots_of_aliases", </s> add req: &urlfilter.DNSRequest{ Hostname: "simplehost", DNSType: dns.TypeA, }, name: "simple", </s> remove Hostname: "simplehost", </s> add Hostname: "hello.world", </s> remove Hostname: "hello.world", </s> add Hostname: "hello.world.again", </s> remove name: "hello_alias", </s> add }, {
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep replace replace replace replace replace keep replace replace
<mask> Value: net.ParseIP("::"), <mask> RRType: dns.TypeAAAA, <mask> }}, <mask> name: "other_line_alias", <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "hello.world.again", <mask> DNSType: dns.TypeA, <mask> }, <mask> }, { <mask> want: []*rules.DNSRewrite{}, <mask> name: "hello_subdomain", </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove name: "hello_alias", </s> add }, { </s> remove Hostname: "hello.world", </s> add Hostname: "hello.world.again", </s> remove }, { </s> add name: "hello_subdomain", </s> remove name: "reverse", req: &urlfilter.DNSRequest{ Hostname: "1.0.0.1.in-addr.arpa", DNSType: dns.TypePTR, }, </s> add </s> remove }, { </s> add name: "other_line_alias",
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep replace keep keep keep keep keep keep keep keep replace keep
<mask> Hostname: "say.hello", <mask> DNSType: dns.TypeA, <mask> }, <mask> }, { <mask> want: []*rules.DNSRewrite{}, <mask> name: "hello_alias_subdomain", <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "say.hello.world", <mask> DNSType: dns.TypeA, <mask> }, <mask> }, { <mask> want: []*rules.DNSRewrite{}, <mask> name: "hello_alias_subdomain", <mask> req: &urlfilter.DNSRequest{ </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> add name: "hello_alias_subdomain", want: []*rules.DNSRewrite{}, </s> remove want: []*rules.DNSRewrite{}, name: "hello_subdomain", </s> add </s> add req: &urlfilter.DNSRequest{ Hostname: "for.testing", DNSType: dns.TypeA, }, name: "lots_of_aliases", </s> remove name: "other_line_alias", req: &urlfilter.DNSRequest{ Hostname: "hello.world.again", DNSType: dns.TypeA, }, </s> add </s> remove want: []*rules.DNSRewrite{}, name: "non-existing", </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep add keep keep keep keep keep keep
<mask> DNSType: dns.TypeA, <mask> }, <mask> }, { <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "for.testing", <mask> DNSType: dns.TypeA, <mask> }, <mask> name: "lots_of_aliases", </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove name: "lots_of_aliases", </s> add }, { </s> remove Hostname: "for.testing", DNSType: dns.TypeA, </s> add Hostname: "1.0.0.1.in-addr.arpa", DNSType: dns.TypePTR, </s> add req: &urlfilter.DNSRequest{ Hostname: "for.testing", DNSType: dns.TypeA, }, name: "lots_of_aliases", </s> remove }, { </s> add name: "reverse", </s> add name: "bad_type", want: nil, </s> remove name: "hello_alias_subdomain", </s> add }, {
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep add keep keep keep keep keep keep
<mask> name: "hello_alias_subdomain", <mask> want: []*rules.DNSRewrite{}, <mask> }, { <mask> want: []*rules.DNSRewrite{{ <mask> RCode: dns.RcodeSuccess, <mask> RRType: dns.TypeA, <mask> Value: net.IPv4(1, 0, 0, 2), <mask> }, { <mask> RCode: dns.RcodeSuccess, </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove }, { </s> add name: "other_line_alias", </s> remove }, { </s> add name: "hello_alias", </s> add req: &urlfilter.DNSRequest{ Hostname: "simplehost", DNSType: dns.TypeA, }, name: "simple", </s> remove want []*rules.DNSRewrite name string </s> add </s> remove name: "hello_alias_subdomain", </s> add }, { </s> add name: "hello_alias_subdomain", want: []*rules.DNSRewrite{},
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace keep replace replace keep keep keep
<mask> RCode: dns.RcodeSuccess, <mask> RRType: dns.TypeAAAA, <mask> Value: net.ParseIP("::2"), <mask> }}, <mask> name: "lots_of_aliases", <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "for.testing", <mask> DNSType: dns.TypeA, <mask> }, <mask> }, { <mask> want: []*rules.DNSRewrite{{ </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> add req: &urlfilter.DNSRequest{ Hostname: "for.testing", DNSType: dns.TypeA, }, name: "lots_of_aliases", </s> remove }, { </s> add name: "reverse", </s> add name: "hello_alias_subdomain", want: []*rules.DNSRewrite{}, </s> remove Hostname: "domain4", DNSType: dns.TypeA, </s> add Hostname: "domain6", DNSType: dns.TypeAAAA, </s> remove Hostname: "hello.world", </s> add Hostname: "hello.world.again",
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "for.testing", <mask> DNSType: dns.TypeA, <mask> }, <mask> }, { <mask> want: []*rules.DNSRewrite{{ <mask> RCode: dns.RcodeSuccess, <mask> RRType: dns.TypePTR, <mask> Value: "simplehost.", <mask> }}, </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove Hostname: "for.testing", DNSType: dns.TypeA, </s> add Hostname: "1.0.0.1.in-addr.arpa", DNSType: dns.TypePTR, </s> remove name: "reverse", req: &urlfilter.DNSRequest{ Hostname: "1.0.0.1.in-addr.arpa", DNSType: dns.TypePTR, }, </s> add </s> remove name: "lots_of_aliases", </s> add }, { </s> add req: &urlfilter.DNSRequest{ Hostname: "for.testing", DNSType: dns.TypeA, }, name: "lots_of_aliases", </s> remove Hostname: "hello.world", </s> add Hostname: "hello.world.again", </s> remove Hostname: "simplehost", </s> add Hostname: "hello.world",
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep replace replace replace replace replace keep replace replace
<mask> Value: "simplehost.", <mask> }}, <mask> name: "reverse", <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "1.0.0.1.in-addr.arpa", <mask> DNSType: dns.TypePTR, <mask> }, <mask> }, { <mask> want: []*rules.DNSRewrite{}, <mask> name: "non-existing", </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove }, { </s> add name: "reverse", </s> add name: "non-existing", want: []*rules.DNSRewrite{}, </s> remove Hostname: "for.testing", DNSType: dns.TypeA, </s> add Hostname: "1.0.0.1.in-addr.arpa", DNSType: dns.TypePTR, </s> remove name: "other_line_alias", req: &urlfilter.DNSRequest{ Hostname: "hello.world.again", DNSType: dns.TypeA, }, </s> add </s> add name: "bad_type", want: nil,
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep add keep keep keep keep keep keep
<mask> DNSType: dns.TypeA, <mask> }, <mask> }, { <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "1.0.0.1.in-addr.arpa", <mask> DNSType: dns.TypeSRV, <mask> }, <mask> name: "bad_type", </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> add name: "bad_type", want: nil, </s> remove want: nil, name: "bad_type", </s> add </s> remove want: []*rules.DNSRewrite{}, name: "non-existing", </s> add </s> remove name: "reverse", req: &urlfilter.DNSRequest{ Hostname: "1.0.0.1.in-addr.arpa", DNSType: dns.TypePTR, }, </s> add </s> remove Hostname: "for.testing", DNSType: dns.TypeA, </s> add Hostname: "1.0.0.1.in-addr.arpa", DNSType: dns.TypePTR, </s> remove name: "hello_alias_subdomain", </s> add }, {
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> Hostname: "nonexisting", <mask> DNSType: dns.TypeA, <mask> }, <mask> }, { <mask> want: nil, <mask> name: "bad_type", <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "1.0.0.1.in-addr.arpa", <mask> DNSType: dns.TypeSRV, <mask> }, <mask> }, { </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> add name: "bad_type", want: nil, </s> add name: "non-existing", want: []*rules.DNSRewrite{}, </s> remove want: []*rules.DNSRewrite{}, name: "non-existing", </s> add </s> remove name: "reverse", req: &urlfilter.DNSRequest{ Hostname: "1.0.0.1.in-addr.arpa", DNSType: dns.TypePTR, }, </s> add </s> remove Hostname: "for.testing", DNSType: dns.TypeA, </s> add Hostname: "1.0.0.1.in-addr.arpa", DNSType: dns.TypePTR, </s> remove want: []*rules.DNSRewrite{}, name: "hello_subdomain", </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep add keep keep keep keep keep
<mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "1.0.0.1.in-addr.arpa", <mask> DNSType: dns.TypeSRV, <mask> }, <mask> }, { <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "domain", <mask> DNSType: dns.TypeA, <mask> }, </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove want: nil, name: "bad_type", </s> add </s> add name: "non-existing", want: []*rules.DNSRewrite{}, </s> remove want: []*rules.DNSRewrite{}, name: "non-existing", </s> add </s> remove name: "issue_4216_4_6", </s> add }, { </s> remove Hostname: "domain", </s> add Hostname: "domain4", </s> remove name: "reverse", req: &urlfilter.DNSRequest{ Hostname: "1.0.0.1.in-addr.arpa", DNSType: dns.TypePTR, }, </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep add keep keep keep keep
<mask> want: nil, <mask> }, { <mask> want: []*rules.DNSRewrite{{ <mask> RCode: dns.RcodeSuccess, <mask> RRType: dns.TypeA, <mask> Value: net.IPv4(4, 2, 1, 6), </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove }, { </s> add name: "issue_4216_6", </s> add req: &urlfilter.DNSRequest{ Hostname: "for.testing", DNSType: dns.TypeA, }, name: "lots_of_aliases", </s> remove }, { </s> add name: "other_line_alias", </s> remove }, { </s> add name: "hello_alias", </s> remove }, { </s> add name: "issue_4216_4", </s> remove }, { </s> add name: "reverse",
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep replace keep replace keep keep keep
<mask> }}, <mask> name: "issue_4216_4_6", <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "domain", <mask> DNSType: dns.TypeA, <mask> }, <mask> }, { </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> add req: &urlfilter.DNSRequest{ Hostname: "domain", DNSType: dns.TypeA, }, name: "issue_4216_4_6", </s> add name: "bad_type", want: nil, </s> remove }, { </s> add name: "issue_4216_4", </s> remove name: "simple", </s> add }, { </s> remove name: "hello_alias", </s> add }, {
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "domain", <mask> DNSType: dns.TypeA, <mask> }, <mask> }, { <mask> want: []*rules.DNSRewrite{{ <mask> RCode: dns.RcodeSuccess, <mask> RRType: dns.TypeA, <mask> Value: net.IPv4(7, 5, 3, 1), <mask> }, { </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove Hostname: "domain4", DNSType: dns.TypeA, </s> add Hostname: "domain6", DNSType: dns.TypeAAAA, </s> remove name: "issue_4216_4", </s> add }, { </s> remove Hostname: "domain", </s> add Hostname: "domain4", </s> remove name: "issue_4216_4_6", </s> add }, { </s> add req: &urlfilter.DNSRequest{ Hostname: "domain", DNSType: dns.TypeA, }, name: "issue_4216_4_6", </s> add req: &urlfilter.DNSRequest{ Hostname: "simplehost", DNSType: dns.TypeA, }, name: "simple",
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep replace keep replace replace
<mask> }}, <mask> name: "issue_4216_4", <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "domain4", <mask> DNSType: dns.TypeA, </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove Hostname: "domain", </s> add Hostname: "domain4", </s> remove }, { </s> add name: "issue_4216_6", </s> remove }, { </s> add name: "issue_4216_4", </s> remove name: "other_line_alias", req: &urlfilter.DNSRequest{ Hostname: "hello.world.again", DNSType: dns.TypeA, }, </s> add </s> remove name: "reverse", req: &urlfilter.DNSRequest{ Hostname: "1.0.0.1.in-addr.arpa", DNSType: dns.TypePTR, }, </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "domain4", <mask> DNSType: dns.TypeA, <mask> }, <mask> }, { <mask> want: []*rules.DNSRewrite{{ <mask> RCode: dns.RcodeSuccess, <mask> RRType: dns.TypeAAAA, <mask> Value: net.ParseIP("::13"), <mask> }, { </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove Hostname: "domain4", DNSType: dns.TypeA, </s> add Hostname: "domain6", DNSType: dns.TypeAAAA, </s> remove Hostname: "domain", </s> add Hostname: "domain4", </s> remove name: "issue_4216_4", </s> add }, { </s> remove Hostname: "hello.world", </s> add Hostname: "hello.world.again", </s> remove Hostname: "simplehost", </s> add Hostname: "hello.world", </s> remove name: "lots_of_aliases", </s> add }, {
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> RCode: dns.RcodeSuccess, <mask> RRType: dns.TypeAAAA, <mask> Value: net.ParseIP("::31"), <mask> }}, <mask> name: "issue_4216_6", <mask> req: &urlfilter.DNSRequest{ <mask> Hostname: "domain6", <mask> DNSType: dns.TypeAAAA, <mask> }, <mask> }} <mask> <mask> stubWatcher := aghtest.FSWatcher{ <mask> OnEvents: func() (e <-chan struct{}) { return nil }, <mask> OnAdd: func(name string) (err error) { return nil }, </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove Hostname: "domain4", DNSType: dns.TypeA, </s> add Hostname: "domain6", DNSType: dns.TypeAAAA, </s> remove }, { </s> add name: "issue_4216_6", </s> remove name: "simple", </s> add }, { </s> remove name: "issue_4216_4_6", </s> add }, { </s> remove name: "hello_alias", </s> add }, { </s> remove name: "lots_of_aliases", </s> add }, {
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/hostscontainer_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> refresh() (err error) <mask> } <mask> <mask> // NewSystemResolvers returns a SystemResolvers with the cache refresh rate <mask> // defined by refreshIvl. It disables auto-resfreshing if refreshIvl is 0. If <mask> // nil is passed for hostGenFunc, the default generator will be used. <mask> func NewSystemResolvers( <mask> hostGenFunc HostGenFunc, <mask> ) (sr SystemResolvers, err error) { <mask> sr = newSystemResolvers(hostGenFunc) </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For // each ip the first member of hosts will become the main one. func (hp *hostsParser) addPairs(ip net.IP, hosts []string) { v, ok := hp.table.Get(ip) if !ok { // This ip is added at the first time. v = stringutil.NewSet() hp.table.Set(ip, v) </s> add // HostsRecord represents a single hosts file record. type HostsRecord struct { Aliases *stringutil.Set Canonical string } // Equal returns true if all fields of rec are equal to field in other or they // both are nil. func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) { if rec == nil { return other == nil </s> remove // map's values are guaranteed to be of type of *stringutil.Set. </s> add // map's values are guaranteed to be of type of *HostsRecord. </s> add // addRules adds rules and rule translations for the line. func (hp *hostsParser) addRules(ip net.IP, host, line string) { rule, rulePtr := hp.writeRules(host, ip) hp.translations[rule], hp.translations[rulePtr] = line, line log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, host) } </s> remove var set *stringutil.Set set, ok = v.(*stringutil.Set) </s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases) } // addRecord puts the record for the IP address to the rules builder if needed. // The first host is considered to be the canonical name for the IP address. // hosts must have at least one name. func (hp *hostsParser) addRecord(ip net.IP, hosts []string) { line := strings.Join(append([]string{ip.String()}, hosts...), " ") var rec *HostsRecord v, ok := hp.table.Get(ip) </s> add // target's values must be of type *HostsRecord. </s> remove // Return true if every value from the IP map has no discrepancies with the // appropriate one from the target. return !ok </s> add return ok
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/aghnet/systemresolvers.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> } <mask> <mask> // addHostLocked adds a new IP-hostname pairing. For internal use only. <mask> func (clients *clientsContainer) addHostLocked(ip net.IP, host string, src clientSource) (ok bool) { <mask> var rc *RuntimeClient <mask> rc, ok = clients.findRuntimeClientLocked(ip) <mask> if ok { <mask> if rc.Source > src { <mask> return false <mask> } <mask> </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) { // ok is set to true if the target doesn't contain ip or if the // appropriate hosts set isn't equal to the checked one. if a, hasIP := target.Get(ip); !hasIP { ok = true } else if hosts, aok := a.(*stringutil.Set); aok { ok = !hosts.Equal(b.(*stringutil.Set)) </s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) { var targetVal interface{} targetVal, ok = target.Get(ip) if !ok { return false </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For // each ip the first member of hosts will become the main one. func (hp *hostsParser) addPairs(ip net.IP, hosts []string) { v, ok := hp.table.Get(ip) if !ok { // This ip is added at the first time. v = stringutil.NewSet() hp.table.Set(ip, v) </s> add // HostsRecord represents a single hosts file record. type HostsRecord struct { Aliases *stringutil.Set Canonical string } // Equal returns true if all fields of rec are equal to field in other or they // both are nil. func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) { if rec == nil { return other == nil </s> remove // Continue only if maps has no discrepancies. return !ok </s> add var rec *HostsRecord rec, ok = recVal.(*HostsRecord) if !ok { log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal) return false } var targetRec *HostsRecord targetRec, ok = targetVal.(*HostsRecord) if !ok { log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal) return false } ok = rec.Equal(targetRec) return ok </s> remove log.Debug("clients: added %d client aliases from system hosts-file", n) </s> add log.Debug("clients: added %d client aliases from system hosts file", n) </s> add // target's values must be of type *HostsRecord. </s> add // addRules adds rules and rule translations for the line. func (hp *hostsParser) addRules(ip net.IP, host, line string) { rule, rulePtr := hp.writeRules(host, ip) hp.translations[rule], hp.translations[rulePtr] = line, line log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, host) }
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/home/clients.go
keep keep keep keep replace keep keep keep keep keep
<mask> clients.rmHostsBySrc(ClientSourceHostsFile) <mask> <mask> n := 0 <mask> hosts.Range(func(ip net.IP, v interface{}) (cont bool) { <mask> hosts, ok := v.(*stringutil.Set) <mask> if !ok { <mask> log.Error("dns: bad type %T in ipToRC for %s", v, ip) <mask> <mask> return true <mask> } </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) { // ok is set to true if the target doesn't contain ip or if the // appropriate hosts set isn't equal to the checked one. if a, hasIP := target.Get(ip); !hasIP { ok = true } else if hosts, aok := a.(*stringutil.Set); aok { ok = !hosts.Equal(b.(*stringutil.Set)) </s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) { var targetVal interface{} targetVal, ok = target.Get(ip) if !ok { return false </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For // each ip the first member of hosts will become the main one. func (hp *hostsParser) addPairs(ip net.IP, hosts []string) { v, ok := hp.table.Get(ip) if !ok { // This ip is added at the first time. v = stringutil.NewSet() hp.table.Set(ip, v) </s> add // HostsRecord represents a single hosts file record. type HostsRecord struct { Aliases *stringutil.Set Canonical string } // Equal returns true if all fields of rec are equal to field in other or they // both are nil. func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) { if rec == nil { return other == nil </s> remove return </s> add rec.Canonical, hosts = hosts[0], hosts[1:] hp.addRules(ip, rec.Canonical, line) hp.table.Set(ip, rec) } else { rec, ok = v.(*HostsRecord) if !ok { log.Error("%s: adding pairs: unexpected type %T", hostsContainerPref, v) return } </s> remove var set *stringutil.Set set, ok = v.(*stringutil.Set) </s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases) } // addRecord puts the record for the IP address to the rules builder if needed. // The first host is considered to be the canonical name for the IP address. // hosts must have at least one name. func (hp *hostsParser) addRecord(ip net.IP, hosts []string) { line := strings.Join(append([]string{ip.String()}, hosts...), " ") var rec *HostsRecord v, ok := hp.table.Get(ip) </s> remove // Continue only if maps has no discrepancies. return !ok </s> add var rec *HostsRecord rec, ok = recVal.(*HostsRecord) if !ok { log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal) return false } var targetRec *HostsRecord targetRec, ok = targetVal.(*HostsRecord) if !ok { log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal) return false } ok = rec.Equal(targetRec) return ok </s> remove hosts.Range(func(name string) (cont bool) { if clients.addHostLocked(ip, name, ClientSourceHostsFile) { n++ } return true }) </s> add clients.addHostLocked(ip, rec.Canonical, ClientSourceHostsFile) n++
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/home/clients.go
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
<mask> <mask> return true <mask> } <mask> <mask> hosts.Range(func(name string) (cont bool) { <mask> if clients.addHostLocked(ip, name, ClientSourceHostsFile) { <mask> n++ <mask> } <mask> <mask> return true <mask> }) <mask> <mask> return true <mask> }) <mask> <mask> log.Debug("clients: added %d client aliases from system hosts-file", n) </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove log.Debug("clients: added %d client aliases from system hosts-file", n) </s> add log.Debug("clients: added %d client aliases from system hosts file", n) </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) { // ok is set to true if the target doesn't contain ip or if the // appropriate hosts set isn't equal to the checked one. if a, hasIP := target.Get(ip); !hasIP { ok = true } else if hosts, aok := a.(*stringutil.Set); aok { ok = !hosts.Equal(b.(*stringutil.Set)) </s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) { var targetVal interface{} targetVal, ok = target.Get(ip) if !ok { return false </s> remove hosts, ok := v.(*stringutil.Set) </s> add rec, ok := v.(*aghnet.HostsRecord) </s> remove // Return true if every value from the IP map has no discrepancies with the // appropriate one from the target. return !ok </s> add return ok </s> remove // Continue only if maps has no discrepancies. return !ok </s> add var rec *HostsRecord rec, ok = recVal.(*HostsRecord) if !ok { log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal) return false } var targetRec *HostsRecord targetRec, ok = targetVal.(*HostsRecord) if !ok { log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal) return false } ok = rec.Equal(targetRec) return ok </s> add // target's values must be of type *HostsRecord.
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/home/clients.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> return true <mask> }) <mask> <mask> log.Debug("clients: added %d client aliases from system hosts-file", n) <mask> } <mask> <mask> // addFromSystemARP adds the IP-hostname pairings from the output of the arp -a <mask> // command. <mask> func (clients *clientsContainer) addFromSystemARP() { </s> Pull request: all: use canonical names for hosts file runtime clients Updates #4683. Squashed commit of the following: commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801 Author: Ainar Garipov <[email protected]> Date: Thu Jul 7 19:13:29 2022 +0300 all: use canonical names for hosts file runtime clients </s> remove hosts.Range(func(name string) (cont bool) { if clients.addHostLocked(ip, name, ClientSourceHostsFile) { n++ } return true }) </s> add clients.addHostLocked(ip, rec.Canonical, ClientSourceHostsFile) n++ </s> remove // Return true if every value from the IP map has no discrepancies with the // appropriate one from the target. return !ok </s> add return ok </s> remove // Continue only if maps has no discrepancies. return !ok </s> add var rec *HostsRecord rec, ok = recVal.(*HostsRecord) if !ok { log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal) return false } var targetRec *HostsRecord targetRec, ok = targetVal.(*HostsRecord) if !ok { log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal) return false } ok = rec.Equal(targetRec) return ok </s> remove var rc *RuntimeClient rc, ok = clients.findRuntimeClientLocked(ip) </s> add rc, ok := clients.findRuntimeClientLocked(ip) </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For // each ip the first member of hosts will become the main one. func (hp *hostsParser) addPairs(ip net.IP, hosts []string) { v, ok := hp.table.Get(ip) if !ok { // This ip is added at the first time. v = stringutil.NewSet() hp.table.Set(ip, v) </s> add // HostsRecord represents a single hosts file record. type HostsRecord struct { Aliases *stringutil.Set Canonical string } // Equal returns true if all fields of rec are equal to field in other or they // both are nil. func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) { if rec == nil { return other == nil </s> add // addRules adds rules and rule translations for the line. func (hp *hostsParser) addRules(ip net.IP, host, line string) { rule, rulePtr := hp.writeRules(host, ip) hp.translations[rule], hp.translations[rulePtr] = line, line log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, host) }
https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9
internal/home/clients.go
keep add keep keep keep keep keep
<mask> Header: 'IP', <mask> accessor: 'ip', <mask> }, { <mask> Header: 'Requests count', <mask> accessor: 'domain', <mask> Cell: ({ value }) => { <mask> const { </s> Fix footer links Closes #360 </s> add Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), </s> add Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>),
https://github.com/AdguardTeam/AdGuardHome/commit/35368619b0d7ed0fb838d749cd7b2f63ae9c9aa3
client/src/components/Dashboard/BlockedDomains.js
keep keep add keep keep keep keep keep keep
<mask> columns = [{ <mask> Header: 'IP', <mask> accessor: 'ip', <mask> }, { <mask> Header: 'Requests count', <mask> accessor: 'count', <mask> Cell: ({ value }) => { <mask> const percent = getPercent(this.props.dnsQueries, value); <mask> const percentColor = this.getPercentColor(percent); </s> Fix footer links Closes #360 </s> add Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), </s> add Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>),
https://github.com/AdguardTeam/AdGuardHome/commit/35368619b0d7ed0fb838d749cd7b2f63ae9c9aa3
client/src/components/Dashboard/Clients.js
keep keep add keep keep keep keep keep keep
<mask> columns = [{ <mask> Header: 'IP', <mask> accessor: 'ip', <mask> }, { <mask> Header: 'Requests count', <mask> accessor: 'count', <mask> Cell: ({ value }) => { <mask> const percent = getPercent(this.props.dnsQueries, value); <mask> const percentColor = this.getPercentColor(percent); </s> Fix footer links Closes #360
https://github.com/AdguardTeam/AdGuardHome/commit/35368619b0d7ed0fb838d749cd7b2f63ae9c9aa3
client/src/components/Dashboard/QueriedDomains.js
keep keep keep keep replace keep keep keep keep keep
<mask> "example_upstream_regular": "DNS reguler (melalui UDP);", <mask> "example_upstream_udp": "DNS biasa (lebih dari UDP, nama host);", <mask> "example_upstream_dot": "terenkripsi <0>DNS-over-TLS</0>;", <mask> "example_upstream_doh": "terenkripsi <0>DNS-over-HTTPS</0>;", <mask> "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0> (eksperimental);", <mask> "example_upstream_sdns": "<0>Stempel DNS</0> untuk <1>DNSCrypt</1> atau pengarah <2>DNS-over-HTTPS</2>;", <mask> "example_upstream_tcp": "DNS reguler (melalui TCP);", <mask> "example_upstream_tcp_hostname": "DNS biasa (lebih dari TCP, nama host);", <mask> "all_lists_up_to_date_toast": "Semua daftar sudah diperbarui", <mask> "updated_upstream_dns_toast": "Server upstream berhasil disimpan", </s> Pull request: client: upd i18n Merge in DNS/adguard-home from upd-i18n to master Squashed commit of the following: commit 3feadfe31609ef52726b582ad6ba18bfa435a081 Author: Ainar Garipov <[email protected]> Date: Fri Jun 3 16:34:36 2022 +0300 client: upd i18n </s> remove "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0> (experimenteel);", </s> add "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0>;", </s> remove "example_upstream_doq": "<0>DNS su QUIC</0> crittografato (sperimentale);", </s> add "example_upstream_doq": "<0>DNS su QUIC</0> crittografato;", </s> remove "encryption_doq": "Port DNS-over-QUIC (eksperimental)", "encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini. Ini adalah eksperimental dan mungkin tidak dapat diandalkan. Juga, tidak banyak klien yang mendukungnya saat ini.", </s> add "encryption_doq": "Port DNS-over-QUIC ", "encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini.",
https://github.com/AdguardTeam/AdGuardHome/commit/368a98fb296da349ed7fb99b03c4ed6b7d0dda3a
client/src/__locales/id.json
keep keep keep keep replace replace keep keep keep keep keep
<mask> "encryption_https": "Port HTTPS", <mask> "encryption_https_desc": "Jika port HTTPS dikonfigurasi, antarmuka admin Home AdGuard akan dapat diakses melalui HTTPS, dan itu juga akan memberikan DNS-over-HTTPS di lokasi '/ dns-query'.", <mask> "encryption_dot": "Port DNS-over-TLS", <mask> "encryption_dot_desc": "Jika port ini terkonfigurasi, AdGuard Home akan menjalankan server DNS-over-TLS dalam port ini", <mask> "encryption_doq": "Port DNS-over-QUIC (eksperimental)", <mask> "encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini. Ini adalah eksperimental dan mungkin tidak dapat diandalkan. Juga, tidak banyak klien yang mendukungnya saat ini.", <mask> "encryption_certificates": "Sertifikat", <mask> "encryption_certificates_desc": "Untuk menggunakan enkripsi, Anda perlu memberikan rantai sertifikat SSL yang valid untuk domain Anda. Anda bisa mendapatkan sertifikat gratis di <0>{{link}}</0> atau Anda dapat membelinya dari salah satu Otoritas Sertifikat tepercaya.", <mask> "encryption_certificates_input": "Salin / rekatkan sertifikat PEM yang disandikan di sini.", <mask> "encryption_status": "Status", <mask> "encryption_expire": "Kedaluwarsa", </s> Pull request: client: upd i18n Merge in DNS/adguard-home from upd-i18n to master Squashed commit of the following: commit 3feadfe31609ef52726b582ad6ba18bfa435a081 Author: Ainar Garipov <[email protected]> Date: Fri Jun 3 16:34:36 2022 +0300 client: upd i18n </s> remove "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0> (experimenteel);", </s> add "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0>;", </s> remove "example_upstream_doq": "<0>DNS su QUIC</0> crittografato (sperimentale);", </s> add "example_upstream_doq": "<0>DNS su QUIC</0> crittografato;", </s> remove "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0> (eksperimental);", </s> add "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0>;",
https://github.com/AdguardTeam/AdGuardHome/commit/368a98fb296da349ed7fb99b03c4ed6b7d0dda3a
client/src/__locales/id.json
keep keep keep keep replace keep keep keep keep keep
<mask> "example_upstream_regular": "DNS regolare (over UDP);", <mask> "example_upstream_udp": "DNS regolare (over UDP, nome host);", <mask> "example_upstream_dot": "<0>DNS su TLS</0> crittografato;", <mask> "example_upstream_doh": "<0>DNS su HTTPS</0> crittografato;", <mask> "example_upstream_doq": "<0>DNS su QUIC</0> crittografato (sperimentale);", <mask> "example_upstream_sdns": "<0>DNS Stamps</0> per <1>DNSCrypt</1> oppure i risolutori <2>DNS su HTTPS</2>;", <mask> "example_upstream_tcp": "DNS regolare (over TCP);", <mask> "example_upstream_tcp_hostname": "DNS regolare (over TCP, nome host);", <mask> "all_lists_up_to_date_toast": "Tutti gli elenchi sono aggiornati", <mask> "updated_upstream_dns_toast": "I server upstream sono stati salvati correttamente", </s> Pull request: client: upd i18n Merge in DNS/adguard-home from upd-i18n to master Squashed commit of the following: commit 3feadfe31609ef52726b582ad6ba18bfa435a081 Author: Ainar Garipov <[email protected]> Date: Fri Jun 3 16:34:36 2022 +0300 client: upd i18n </s> remove "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0> (experimenteel);", </s> add "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0>;", </s> remove "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0> (eksperimental);", </s> add "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0>;", </s> remove "encryption_doq": "Port DNS-over-QUIC (eksperimental)", "encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini. Ini adalah eksperimental dan mungkin tidak dapat diandalkan. Juga, tidak banyak klien yang mendukungnya saat ini.", </s> add "encryption_doq": "Port DNS-over-QUIC ", "encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini.",
https://github.com/AdguardTeam/AdGuardHome/commit/368a98fb296da349ed7fb99b03c4ed6b7d0dda3a
client/src/__locales/it.json
keep keep keep keep replace keep keep keep keep keep
<mask> "example_upstream_regular": "standaard DNS (over UDP);", <mask> "example_upstream_udp": "standaard DNS (via UDP, hostnaam);", <mask> "example_upstream_dot": "versleutelde <0>DNS-via-TLS</0>;", <mask> "example_upstream_doh": "versleutelde <0>DNS-via-HTTPS</0>;", <mask> "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0> (experimenteel);", <mask> "example_upstream_sdns": "<0>DNS Stamps</0> voor <1>DNSCrypt</1> of <2>DNS-via-HTTPS</2> oplossingen;", <mask> "example_upstream_tcp": "standaard DNS (over TCP);", <mask> "example_upstream_tcp_hostname": "standaard DNS (via TCP, hostnaam);", <mask> "all_lists_up_to_date_toast": "Alle lijsten zijn reeds actueel", <mask> "updated_upstream_dns_toast": "Upstream-servers succesvol opgeslagen", </s> Pull request: client: upd i18n Merge in DNS/adguard-home from upd-i18n to master Squashed commit of the following: commit 3feadfe31609ef52726b582ad6ba18bfa435a081 Author: Ainar Garipov <[email protected]> Date: Fri Jun 3 16:34:36 2022 +0300 client: upd i18n </s> remove "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0> (eksperimental);", </s> add "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0>;", </s> remove "example_upstream_doq": "<0>DNS su QUIC</0> crittografato (sperimentale);", </s> add "example_upstream_doq": "<0>DNS su QUIC</0> crittografato;", </s> remove "encryption_doq": "Port DNS-over-QUIC (eksperimental)", "encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini. Ini adalah eksperimental dan mungkin tidak dapat diandalkan. Juga, tidak banyak klien yang mendukungnya saat ini.", </s> add "encryption_doq": "Port DNS-over-QUIC ", "encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini.",
https://github.com/AdguardTeam/AdGuardHome/commit/368a98fb296da349ed7fb99b03c4ed6b7d0dda3a
client/src/__locales/nl.json
keep keep keep keep replace keep keep keep keep keep
<mask> "strconv" <mask> "syscall" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/gobuffalo/packr" <mask> "golang.org/x/crypto/ssh/terminal" <mask> ) <mask> <mask> // VersionString will be set through ldflags, contains current version </s> move log wrapper library outside into hmage/golibs/log </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
app.go
keep keep add keep keep keep keep keep keep
<mask> "time" <mask> <mask> "github.com/gobuffalo/packr" <mask> "golang.org/x/crypto/ssh/terminal" <mask> ) <mask> <mask> // VersionString will be set through ldflags, contains current version <mask> var VersionString = "undefined" <mask> </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
app.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> "github.com/AdguardTeam/AdGuardHome/dhcpd" <mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter" <mask> "github.com/AdguardTeam/AdGuardHome/dnsforward" <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "gopkg.in/yaml.v2" <mask> ) <mask> <mask> const ( <mask> dataDir = "data" // data storage </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
config.go
keep keep keep keep replace keep keep keep keep keep
<mask> "strings" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dnsforward" <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/miekg/dns" <mask> "gopkg.in/asaskevich/govalidator.v4" <mask> ) <mask> </s> move log wrapper library outside into hmage/golibs/log </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
control.go
keep keep add keep keep keep keep keep
<mask> <mask> "github.com/AdguardTeam/AdGuardHome/dnsforward" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/miekg/dns" <mask> "gopkg.in/asaskevich/govalidator.v4" <mask> ) <mask> <mask> const updatePeriod = time.Minute * 30 </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
control.go
keep keep keep keep replace keep keep keep keep keep
<mask> "strings" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dhcpd" <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/joomcode/errorx" <mask> ) <mask> <mask> var dhcpServer = dhcpd.Server{} <mask> </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dhcp.go
keep keep keep keep replace keep keep keep keep keep
<mask> "net" <mask> "os" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/krolaw/dhcp4" <mask> ) <mask> <mask> func CheckIfOtherDHCPServersPresent(ifaceName string) (bool, error) { <mask> iface, err := net.InterfaceByName(ifaceName) </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dhcpd/check_other_dhcp.go
keep keep keep keep replace keep keep keep keep keep
<mask> "fmt" <mask> "net" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/krolaw/dhcp4" <mask> ) <mask> <mask> const defaultDiscoverTime = time.Second * 3 <mask> </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dhcpd/dhcpd.go
keep keep keep keep replace keep keep keep keep keep
<mask> "fmt" <mask> "net" <mask> "strings" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/joomcode/errorx" <mask> ) <mask> <mask> func isTimeout(err error) bool { <mask> operr, ok := err.(*net.OpError) </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dhcpd/helpers.go
keep keep keep keep replace keep keep keep keep keep
<mask> "syscall" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dhcpd" <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/krolaw/dhcp4" <mask> ) <mask> <mask> func main() { <mask> if len(os.Args) < 2 { </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dhcpd/standalone/main.go
keep keep keep keep replace keep keep keep keep keep
<mask> "net" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter" <mask> "github.com/AdguardTeam/AdGuardHome/dnsforward" <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/joomcode/errorx" <mask> ) <mask> <mask> var dnsServer = dnsforward.Server{} </s> move log wrapper library outside into hmage/golibs/log </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dns.go
keep add keep keep keep keep keep keep
<mask> "github.com/AdguardTeam/AdGuardHome/dnsforward" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/joomcode/errorx" <mask> ) <mask> <mask> var dnsServer = dnsforward.Server{} <mask> <mask> func isRunning() bool { </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> "sync" <mask> "sync/atomic" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/bluele/gcache" <mask> "golang.org/x/net/publicsuffix" <mask> ) <mask> <mask> const defaultCacheSize = 64 * 1024 // in number of elements </s> move log wrapper library outside into hmage/golibs/log </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dnsfilter/dnsfilter.go
keep add keep keep keep keep keep keep
<mask> <mask> "github.com/bluele/gcache" <mask> "golang.org/x/net/publicsuffix" <mask> ) <mask> <mask> const defaultCacheSize = 64 * 1024 // in number of elements <mask> const defaultCacheTime = 30 * time.Minute <mask> </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<mask> "fmt" <mask> "os" <mask> "runtime" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/shirou/gopsutil/process" <mask> "go.uber.org/goleak" <mask> ) <mask> <mask> // first in file because it must be run first </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dnsfilter/dnsfilter_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> "sync" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter" <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/AdguardTeam/dnsproxy/proxy" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/joomcode/errorx" <mask> "github.com/miekg/dns" <mask> ) </s> move log wrapper library outside into hmage/golibs/log </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dnsforward/dnsforward.go
keep keep keep add keep keep keep keep keep
<mask> <mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter" <mask> "github.com/AdguardTeam/dnsproxy/proxy" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/joomcode/errorx" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> // DefaultTimeout is the default upstream timeout </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> add "github.com/hmage/golibs/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dnsforward/dnsforward.go
keep keep keep keep replace keep keep keep keep keep
<mask> "sync" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter" <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> const ( <mask> logBufferCap = 5000 // maximum capacity of logBuffer before it's flushed to disk </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dnsforward/querylog.go
keep keep keep keep replace keep keep keep keep keep
<mask> "os" <mask> "sync" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/go-test/deep" <mask> ) <mask> <mask> var ( <mask> fileWriteLock sync.Mutex </s> move log wrapper library outside into hmage/golibs/log </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dnsforward/querylog_file.go
keep keep add keep keep keep keep keep
<mask> "time" <mask> <mask> "github.com/go-test/deep" <mask> ) <mask> <mask> var ( <mask> fileWriteLock sync.Mutex <mask> ) </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dnsforward/querylog_file.go
keep keep keep keep replace keep keep keep keep keep
<mask> "strings" <mask> "sync" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "github.com/bluele/gcache" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> type hourTop struct { </s> move log wrapper library outside into hmage/golibs/log </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dnsforward/querylog_top.go
keep add keep keep keep keep
<mask> <mask> "github.com/bluele/gcache" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> type hourTop struct { </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dnsforward/querylog_top.go
keep keep keep keep replace keep keep keep keep keep
<mask> "sync" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter" <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> ) <mask> <mask> var ( <mask> requests = newDNSCounter("requests_total") <mask> filtered = newDNSCounter("filtered_total") </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
dnsforward/stats.go
keep keep keep keep replace keep keep keep keep keep
<mask> "strings" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter" <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> ) <mask> <mask> var ( <mask> nextFilterID = time.Now().Unix() // semi-stable way to generate an unique ID <mask> filterTitleRegexp = regexp.MustCompile(`^! Title: +(.*)$`) </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
filter.go
keep keep keep add keep keep keep keep keep keep
<mask> github.com/davecgh/go-spew v1.1.1 <mask> github.com/go-ole/go-ole v1.2.1 // indirect <mask> github.com/go-test/deep v1.0.1 <mask> github.com/gobuffalo/packr v1.19.0 <mask> github.com/jedisct1/go-dnsstamps v0.0.0-20180418170050-1e4999280f86 <mask> github.com/joomcode/errorx v0.1.0 <mask> github.com/krolaw/dhcp4 v0.0.0-20180925202202-7cead472c414 <mask> github.com/miekg/dns v1.1.1 <mask> github.com/patrickmn/go-cache v2.1.0+incompatible <mask> github.com/pkg/errors v0.8.0 </s> move log wrapper library outside into hmage/golibs/log </s> add github.com/hmage/golibs v0.0.0-20181229160906-c8491df0bfc4 h1:FMAReGTEDNr4AdbScv/PqzjMQUpkkVHiF/t8sDHQQVQ= github.com/hmage/golibs v0.0.0-20181229160906-c8491df0bfc4/go.mod h1:H6Ev6svFxUVPFThxLtdnFfcE9e3GWufpfmcVFpqV6HM= </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
go.mod
keep keep add keep keep keep keep keep keep
<mask> github.com/gobuffalo/packd v0.0.0-20181031195726-c82734870264/go.mod h1:Yf2toFaISlyQrr5TfO3h6DB9pl9mZRmyvBGQb/aQ/pI= <mask> github.com/gobuffalo/packr v1.19.0 h1:3UDmBDxesCOPF8iZdMDBBWKfkBoYujIMIZePnobqIUI= <mask> github.com/gobuffalo/packr v1.19.0/go.mod h1:MstrNkfCQhd5o+Ct4IJ0skWlxN8emOq8DsoT1G98VIU= <mask> github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= <mask> github.com/jedisct1/go-dnsstamps v0.0.0-20180418170050-1e4999280f86 h1:Olj4M6T1omUfx7yTTcnhLf4xo6gYMmRHSJIfeA1NZy0= <mask> github.com/jedisct1/go-dnsstamps v0.0.0-20180418170050-1e4999280f86/go.mod h1:j/ONpSHHmPgDwmFKXg9vhQvIjADe/ft1X4a3TVOmp9g= <mask> github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= <mask> github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= <mask> github.com/jmcvetta/randutil v0.0.0-20150817122601-2bb1b664bcff h1:6NvhExg4omUC9NfA+l4Oq3ibNNeJUdiAF3iBVB0PlDk= </s> move log wrapper library outside into hmage/golibs/log </s> add github.com/hmage/golibs v0.0.0-20181229160906-c8491df0bfc4 </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
go.sum
keep keep keep keep replace keep keep keep keep keep
<mask> "io/ioutil" <mask> "net/http" <mask> "strings" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> ) <mask> <mask> // -------------------- <mask> // internationalization <mask> // -------------------- </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
i18n.go
keep keep keep keep replace keep keep keep keep keep
<mask> "io/ioutil" <mask> "os" <mask> "path/filepath" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/log" <mask> "gopkg.in/yaml.v2" <mask> ) <mask> <mask> const currentSchemaVersion = 2 // used for upgrading from old configs to new config <mask> </s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log" </s> add "github.com/hmage/golibs/log"
https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985
upgrade.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> } <mask> <mask> continue <mask> } <mask> if ok { <mask> return true, nil <mask> } <mask> if err != nil { <mask> return false, err <mask> } <mask> } <mask> } </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove if ok { return true, nil } </s> add </s> add return ok, nil </s> add type netIface interface { Addrs() ([]net.Addr, error) } </s> remove func ifaceIPv6Addrs(iface *net.Interface) (ips []net.IP, err error) { </s> add func ifaceIPv6Addrs(iface netIface) (ips []net.IP, err error) { </s> remove func (s *winServer) ResetLeases(leases []*Lease) { } func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) { } func (s *winServer) WriteDiskConfig6(c *V6ServerConf) { } func (s *winServer) Start() error { return nil } func (s *winServer) Stop() { } func (s *winServer) Reset() { } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add func (s *winServer) ResetLeases(leases []*Lease) {} func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() error { return nil } func (s *winServer) Stop() {} func (s *winServer) Reset() {} func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> remove if ip := ipnet.IP.To16(); ip != nil { ips = append(ips, ip) </s> add if ip := ipnet.IP.To4(); ip == nil { // Assume that net.(*Interface).Addrs can only return // valid IPv4 and IPv6 addresses. Since this isn't an // IPv4 address, it must be an IPv6 one. ips = append(ips, ipnet.IP)
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/check_other_dhcp.go
keep keep keep add keep keep keep keep keep
<mask> } <mask> if err != nil { <mask> return false, err <mask> } <mask> } <mask> } <mask> <mask> // TODO(a.garipov): Refactor further. Inspect error handling, remove parameter <mask> // next, address the TODO, merge with tryConn6, etc. </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove if ok { return true, nil } </s> add </s> remove if ok { return true, nil } </s> add </s> add type netIface interface { Addrs() ([]net.Addr, error) } </s> remove func ifaceIPv6Addrs(iface *net.Interface) (ips []net.IP, err error) { </s> add func ifaceIPv6Addrs(iface netIface) (ips []net.IP, err error) { </s> remove func (s *winServer) ResetLeases(leases []*Lease) { } func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) { } func (s *winServer) WriteDiskConfig6(c *V6ServerConf) { } func (s *winServer) Start() error { return nil } func (s *winServer) Stop() { } func (s *winServer) Reset() { } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add func (s *winServer) ResetLeases(leases []*Lease) {} func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() error { return nil } func (s *winServer) Stop() {} func (s *winServer) Reset() {} func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> remove if ip := ipnet.IP.To16(); ip != nil { ips = append(ips, ip) </s> add if ip := ipnet.IP.To4(); ip == nil { // Assume that net.(*Interface).Addrs can only return // valid IPv4 and IPv6 addresses. Since this isn't an // IPv4 address, it must be an IPv6 one. ips = append(ips, ipnet.IP)
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/check_other_dhcp.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> } <mask> <mask> continue <mask> } <mask> if ok { <mask> return true, nil <mask> } <mask> if err != nil { <mask> return false, err <mask> } <mask> } <mask> } </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/check_other_dhcp.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> return mc, serverConn <mask> } <mask> <mask> func ComparePacket(got *dhcpv4.DHCPv4, want *dhcpv4.DHCPv4) error { <mask> if got == nil && got == want { <mask> return nil <mask> } <mask> if (want == nil || got == nil) && (got != want) { <mask> return fmt.Errorf("packet got %v, want %v", got, want) </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove func pktsExpected(got []*dhcpv4.DHCPv4, want []*dhcpv4.DHCPv4) error { </s> add func pktsExpected(got, want []*dhcpv4.DHCPv4) error { </s> remove func udpMatch(addr *net.UDPAddr, bound *net.UDPAddr) bool { </s> add func udpMatch(addr, bound *net.UDPAddr) bool { </s> remove if ip := ipnet.IP.To16(); ip != nil { ips = append(ips, ip) </s> add if ip := ipnet.IP.To4(); ip == nil { // Assume that net.(*Interface).Addrs can only return // valid IPv4 and IPv6 addresses. Since this isn't an // IPv4 address, it must be an IPv6 one. ips = append(ips, ipnet.IP) </s> remove func (s *winServer) ResetLeases(leases []*Lease) { } func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) { } func (s *winServer) WriteDiskConfig6(c *V6ServerConf) { } func (s *winServer) Start() error { return nil } func (s *winServer) Stop() { } func (s *winServer) Reset() { } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add func (s *winServer) ResetLeases(leases []*Lease) {} func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() error { return nil } func (s *winServer) Stop() {} func (s *winServer) Reset() {} func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> remove if ok { return true, nil } </s> add </s> remove if ok { return true, nil } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/nclient4/client_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> return nil <mask> } <mask> <mask> func pktsExpected(got []*dhcpv4.DHCPv4, want []*dhcpv4.DHCPv4) error { <mask> if len(got) != len(want) { <mask> return fmt.Errorf("got %d packets, want %d packets", len(got), len(want)) <mask> } <mask> <mask> for i := range got { </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove func ComparePacket(got *dhcpv4.DHCPv4, want *dhcpv4.DHCPv4) error { </s> add func ComparePacket(got, want *dhcpv4.DHCPv4) error { </s> remove func (s *winServer) ResetLeases(leases []*Lease) { } func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) { } func (s *winServer) WriteDiskConfig6(c *V6ServerConf) { } func (s *winServer) Start() error { return nil } func (s *winServer) Stop() { } func (s *winServer) Reset() { } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add func (s *winServer) ResetLeases(leases []*Lease) {} func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() error { return nil } func (s *winServer) Stop() {} func (s *winServer) Reset() {} func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> remove if ok { return true, nil } </s> add </s> remove if ok { return true, nil } </s> add </s> add type netIface interface { Addrs() ([]net.Addr, error) } </s> remove func udpMatch(addr *net.UDPAddr, bound *net.UDPAddr) bool { </s> add func udpMatch(addr, bound *net.UDPAddr) bool {
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/nclient4/client_test.go
keep keep replace keep keep replace keep keep keep
<mask> }, <mask> server: [][]*dhcpv4.DHCPv4{ <mask> []*dhcpv4.DHCPv4{ // Response for first packet. <mask> newPacket(dhcpv4.OpcodeBootReply, [4]byte{0x33, 0x33, 0x33, 0x33}), <mask> }, <mask> []*dhcpv4.DHCPv4{ // Response for second packet. <mask> newPacket(dhcpv4.OpcodeBootReply, [4]byte{0x44, 0x44, 0x44, 0x44}), <mask> }, <mask> }, </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove func PseudoHeaderChecksum(protocol TransportProtocolNumber, srcAddr net.IP, dstAddr net.IP) uint16 { </s> add func PseudoHeaderChecksum(protocol TransportProtocolNumber, srcAddr, dstAddr net.IP) uint16 { </s> remove func pktsExpected(got []*dhcpv4.DHCPv4, want []*dhcpv4.DHCPv4) error { </s> add func pktsExpected(got, want []*dhcpv4.DHCPv4) error { </s> remove var ( // BroadcastMac is the broadcast MAC address. // // Any UDP packet sent to this address is broadcast on the subnet. BroadcastMac = net.HardwareAddr([]byte{255, 255, 255, 255, 255, 255}) ) </s> add // BroadcastMac is the broadcast MAC address. // // Any UDP packet sent to this address is broadcast on the subnet. var BroadcastMac = net.HardwareAddr([]byte{255, 255, 255, 255, 255, 255}) </s> remove var ( // ErrUDPAddrIsRequired is an error used when a passed argument is not of type "*net.UDPAddr". ErrUDPAddrIsRequired = errors.New("must supply UDPAddr") ) </s> add // ErrUDPAddrIsRequired is an error used when a passed argument is not of type "*net.UDPAddr". var ErrUDPAddrIsRequired = errors.New("must supply UDPAddr") </s> remove func (b UDP) CalculateChecksum(partialChecksum uint16, totalLen uint16) uint16 { </s> add func (b UDP) CalculateChecksum(partialChecksum, totalLen uint16) uint16 {
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/nclient4/client_test.go
keep keep keep replace replace replace replace replace replace keep replace replace replace replace keep keep keep keep
<mask> "github.com/u-root/u-root/pkg/uio" <mask> ) <mask> <mask> var ( <mask> // BroadcastMac is the broadcast MAC address. <mask> // <mask> // Any UDP packet sent to this address is broadcast on the subnet. <mask> BroadcastMac = net.HardwareAddr([]byte{255, 255, 255, 255, 255, 255}) <mask> ) <mask> <mask> var ( <mask> // ErrUDPAddrIsRequired is an error used when a passed argument is not of type "*net.UDPAddr". <mask> ErrUDPAddrIsRequired = errors.New("must supply UDPAddr") <mask> ) <mask> <mask> // NewRawUDPConn returns a UDP connection bound to the interface and port <mask> // given based on a raw packet socket. All packets are broadcasted. <mask> // </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove func (b UDP) CalculateChecksum(partialChecksum uint16, totalLen uint16) uint16 { </s> add func (b UDP) CalculateChecksum(partialChecksum, totalLen uint16) uint16 { </s> remove func PseudoHeaderChecksum(protocol TransportProtocolNumber, srcAddr net.IP, dstAddr net.IP) uint16 { </s> add func PseudoHeaderChecksum(protocol TransportProtocolNumber, srcAddr, dstAddr net.IP) uint16 { </s> remove if ip := ipnet.IP.To16(); ip != nil { ips = append(ips, ip) </s> add if ip := ipnet.IP.To4(); ip == nil { // Assume that net.(*Interface).Addrs can only return // valid IPv4 and IPv6 addresses. Since this isn't an // IPv4 address, it must be an IPv6 one. ips = append(ips, ipnet.IP) </s> add type netIface interface { Addrs() ([]net.Addr, error) } </s> add return ok, nil
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/nclient4/conn_unix.go
keep keep keep keep replace keep keep keep keep keep
<mask> boundAddr: boundAddr, <mask> } <mask> } <mask> <mask> func udpMatch(addr *net.UDPAddr, bound *net.UDPAddr) bool { <mask> if bound == nil { <mask> return true <mask> } <mask> if bound.IP != nil && !bound.IP.Equal(addr.IP) { <mask> return false </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove func ComparePacket(got *dhcpv4.DHCPv4, want *dhcpv4.DHCPv4) error { </s> add func ComparePacket(got, want *dhcpv4.DHCPv4) error { </s> remove func udp4pkt(packet []byte, dest *net.UDPAddr, src *net.UDPAddr) []byte { </s> add func udp4pkt(packet []byte, dest, src *net.UDPAddr) []byte { </s> remove func (s *winServer) ResetLeases(leases []*Lease) { } func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) { } func (s *winServer) WriteDiskConfig6(c *V6ServerConf) { } func (s *winServer) Start() error { return nil } func (s *winServer) Stop() { } func (s *winServer) Reset() { } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add func (s *winServer) ResetLeases(leases []*Lease) {} func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() error { return nil } func (s *winServer) Stop() {} func (s *winServer) Reset() {} func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> remove if ok { return true, nil } </s> add </s> remove if ok { return true, nil } </s> add </s> remove if ip := ipnet.IP.To16(); ip != nil { ips = append(ips, ip) </s> add if ip := ipnet.IP.To4(); ip == nil { // Assume that net.(*Interface).Addrs can only return // valid IPv4 and IPv6 addresses. Since this isn't an // IPv4 address, it must be an IPv6 one. ips = append(ips, ipnet.IP)
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/nclient4/conn_unix.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> // CalculateChecksum calculates the checksum of the udp packet, given the total <mask> // length of the packet and the checksum of the network-layer pseudo-header <mask> // (excluding the total length) and the checksum of the payload. <mask> func (b UDP) CalculateChecksum(partialChecksum uint16, totalLen uint16) uint16 { <mask> // Add the length portion of the checksum to the pseudo-checksum. <mask> tmp := make([]byte, 2) <mask> binary.BigEndian.PutUint16(tmp, totalLen) <mask> checksum := Checksum(tmp, partialChecksum) <mask> </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove func PseudoHeaderChecksum(protocol TransportProtocolNumber, srcAddr net.IP, dstAddr net.IP) uint16 { </s> add func PseudoHeaderChecksum(protocol TransportProtocolNumber, srcAddr, dstAddr net.IP) uint16 { </s> remove var ( // ErrUDPAddrIsRequired is an error used when a passed argument is not of type "*net.UDPAddr". ErrUDPAddrIsRequired = errors.New("must supply UDPAddr") ) </s> add // ErrUDPAddrIsRequired is an error used when a passed argument is not of type "*net.UDPAddr". var ErrUDPAddrIsRequired = errors.New("must supply UDPAddr") </s> remove var ( // BroadcastMac is the broadcast MAC address. // // Any UDP packet sent to this address is broadcast on the subnet. BroadcastMac = net.HardwareAddr([]byte{255, 255, 255, 255, 255, 255}) ) </s> add // BroadcastMac is the broadcast MAC address. // // Any UDP packet sent to this address is broadcast on the subnet. var BroadcastMac = net.HardwareAddr([]byte{255, 255, 255, 255, 255, 255}) </s> add return ok, nil </s> remove func ifaceIPv6Addrs(iface *net.Interface) (ips []net.IP, err error) { </s> add func ifaceIPv6Addrs(iface netIface) (ips []net.IP, err error) { </s> add type netIface interface { Addrs() ([]net.Addr, error) }
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/nclient4/ipv4.go
keep keep keep keep replace keep keep keep keep keep
<mask> // PseudoHeaderChecksum calculates the pseudo-header checksum for the <mask> // given destination protocol and network address, ignoring the length <mask> // field. Pseudo-headers are needed by transport layers when calculating <mask> // their own checksum. <mask> func PseudoHeaderChecksum(protocol TransportProtocolNumber, srcAddr net.IP, dstAddr net.IP) uint16 { <mask> xsum := Checksum([]byte(srcAddr), 0) <mask> xsum = Checksum([]byte(dstAddr), xsum) <mask> return Checksum([]byte{0, uint8(protocol)}, xsum) <mask> } <mask> </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove func (b UDP) CalculateChecksum(partialChecksum uint16, totalLen uint16) uint16 { </s> add func (b UDP) CalculateChecksum(partialChecksum, totalLen uint16) uint16 { </s> remove func udp4pkt(packet []byte, dest *net.UDPAddr, src *net.UDPAddr) []byte { </s> add func udp4pkt(packet []byte, dest, src *net.UDPAddr) []byte { </s> remove var ( // ErrUDPAddrIsRequired is an error used when a passed argument is not of type "*net.UDPAddr". ErrUDPAddrIsRequired = errors.New("must supply UDPAddr") ) </s> add // ErrUDPAddrIsRequired is an error used when a passed argument is not of type "*net.UDPAddr". var ErrUDPAddrIsRequired = errors.New("must supply UDPAddr") </s> remove if ip := ipnet.IP.To16(); ip != nil { ips = append(ips, ip) </s> add if ip := ipnet.IP.To4(); ip == nil { // Assume that net.(*Interface).Addrs can only return // valid IPv4 and IPv6 addresses. Since this isn't an // IPv4 address, it must be an IPv6 one. ips = append(ips, ipnet.IP) </s> remove var ( // BroadcastMac is the broadcast MAC address. // // Any UDP packet sent to this address is broadcast on the subnet. BroadcastMac = net.HardwareAddr([]byte{255, 255, 255, 255, 255, 255}) ) </s> add // BroadcastMac is the broadcast MAC address. // // Any UDP packet sent to this address is broadcast on the subnet. var BroadcastMac = net.HardwareAddr([]byte{255, 255, 255, 255, 255, 255}) </s> add return ok, nil
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/nclient4/ipv4.go
keep keep keep keep replace keep keep keep keep keep
<mask> xsum = Checksum([]byte(dstAddr), xsum) <mask> return Checksum([]byte{0, uint8(protocol)}, xsum) <mask> } <mask> <mask> func udp4pkt(packet []byte, dest *net.UDPAddr, src *net.UDPAddr) []byte { <mask> ipLen := IPv4MinimumSize <mask> udpLen := UDPMinimumSize <mask> <mask> h := make([]byte, 0, ipLen+udpLen+len(packet)) <mask> hdr := uio.NewBigEndianBuffer(h) </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove func PseudoHeaderChecksum(protocol TransportProtocolNumber, srcAddr net.IP, dstAddr net.IP) uint16 { </s> add func PseudoHeaderChecksum(protocol TransportProtocolNumber, srcAddr, dstAddr net.IP) uint16 { </s> remove func udpMatch(addr *net.UDPAddr, bound *net.UDPAddr) bool { </s> add func udpMatch(addr, bound *net.UDPAddr) bool { </s> remove if ip := ipnet.IP.To16(); ip != nil { ips = append(ips, ip) </s> add if ip := ipnet.IP.To4(); ip == nil { // Assume that net.(*Interface).Addrs can only return // valid IPv4 and IPv6 addresses. Since this isn't an // IPv4 address, it must be an IPv6 one. ips = append(ips, ipnet.IP) </s> remove func pktsExpected(got []*dhcpv4.DHCPv4, want []*dhcpv4.DHCPv4) error { </s> add func pktsExpected(got, want []*dhcpv4.DHCPv4) error { </s> add type netIface interface { Addrs() ([]net.Addr, error) } </s> remove func (b UDP) CalculateChecksum(partialChecksum uint16, totalLen uint16) uint16 { </s> add func (b UDP) CalculateChecksum(partialChecksum, totalLen uint16) uint16 {
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/nclient4/ipv4.go
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
<mask> <mask> type winServer struct { <mask> } <mask> <mask> func (s *winServer) ResetLeases(leases []*Lease) { <mask> } <mask> func (s *winServer) GetLeases(flags int) []Lease { <mask> return nil <mask> } <mask> func (s *winServer) GetLeasesRef() []*Lease { <mask> return nil <mask> } <mask> func (s *winServer) AddStaticLease(lease Lease) error { <mask> return nil <mask> } <mask> func (s *winServer) RemoveStaticLease(l Lease) error { <mask> return nil <mask> } <mask> func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { <mask> return nil <mask> } <mask> <mask> func (s *winServer) WriteDiskConfig4(c *V4ServerConf) { <mask> } <mask> func (s *winServer) WriteDiskConfig6(c *V6ServerConf) { <mask> } <mask> <mask> func (s *winServer) Start() error { <mask> return nil <mask> } <mask> func (s *winServer) Stop() { <mask> } <mask> func (s *winServer) Reset() { <mask> } <mask> <mask> func v4Create(conf V4ServerConf) (DHCPServer, error) { <mask> return &winServer{}, nil <mask> } <mask> <mask> func v6Create(conf V6ServerConf) (DHCPServer, error) { <mask> return &winServer{}, nil <mask> } </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> add type netIface interface { Addrs() ([]net.Addr, error) } </s> remove if ok { return true, nil } </s> add </s> remove if ok { return true, nil } </s> add </s> remove func pktsExpected(got []*dhcpv4.DHCPv4, want []*dhcpv4.DHCPv4) error { </s> add func pktsExpected(got, want []*dhcpv4.DHCPv4) error { </s> remove func udpMatch(addr *net.UDPAddr, bound *net.UDPAddr) bool { </s> add func udpMatch(addr, bound *net.UDPAddr) bool { </s> remove func ComparePacket(got *dhcpv4.DHCPv4, want *dhcpv4.DHCPv4) error { </s> add func ComparePacket(got, want *dhcpv4.DHCPv4) error {
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/v46_windows.go
keep keep keep add keep keep keep keep keep keep
<mask> return <mask> } <mask> } <mask> <mask> // ifaceIPv6Addrs returns the interface's IPv6 addresses. <mask> func ifaceIPv6Addrs(iface netIface) (ips []net.IP, err error) { <mask> addrs, err := iface.Addrs() <mask> if err != nil { <mask> return nil, err <mask> } </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove func ifaceIPv6Addrs(iface *net.Interface) (ips []net.IP, err error) { </s> add func ifaceIPv6Addrs(iface netIface) (ips []net.IP, err error) { </s> remove if ok { return true, nil } </s> add </s> remove if ok { return true, nil } </s> add </s> add return ok, nil </s> remove if ip := ipnet.IP.To16(); ip != nil { ips = append(ips, ip) </s> add if ip := ipnet.IP.To4(); ip == nil { // Assume that net.(*Interface).Addrs can only return // valid IPv4 and IPv6 addresses. Since this isn't an // IPv4 address, it must be an IPv6 one. ips = append(ips, ipnet.IP) </s> remove func (s *winServer) ResetLeases(leases []*Lease) { } func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) { } func (s *winServer) WriteDiskConfig6(c *V6ServerConf) { } func (s *winServer) Start() error { return nil } func (s *winServer) Stop() { } func (s *winServer) Reset() { } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add func (s *winServer) ResetLeases(leases []*Lease) {} func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() error { return nil } func (s *winServer) Stop() {} func (s *winServer) Reset() {} func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil }
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/v6.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> } <mask> <mask> // ifaceIPv6Addrs returns the interface's IPv6 addresses. <mask> func ifaceIPv6Addrs(iface *net.Interface) (ips []net.IP, err error) { <mask> addrs, err := iface.Addrs() <mask> if err != nil { <mask> return nil, err <mask> } <mask> </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> add type netIface interface { Addrs() ([]net.Addr, error) } </s> remove if ok { return true, nil } </s> add </s> remove if ok { return true, nil } </s> add </s> add return ok, nil </s> remove if ip := ipnet.IP.To16(); ip != nil { ips = append(ips, ip) </s> add if ip := ipnet.IP.To4(); ip == nil { // Assume that net.(*Interface).Addrs can only return // valid IPv4 and IPv6 addresses. Since this isn't an // IPv4 address, it must be an IPv6 one. ips = append(ips, ipnet.IP) </s> remove func (s *winServer) ResetLeases(leases []*Lease) { } func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) { } func (s *winServer) WriteDiskConfig6(c *V6ServerConf) { } func (s *winServer) Start() error { return nil } func (s *winServer) Stop() { } func (s *winServer) Reset() { } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add func (s *winServer) ResetLeases(leases []*Lease) {} func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() error { return nil } func (s *winServer) Stop() {} func (s *winServer) Reset() {} func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil }
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/v6.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> if !ok { <mask> continue <mask> } <mask> <mask> if ip := ipnet.IP.To16(); ip != nil { <mask> ips = append(ips, ip) <mask> } <mask> } <mask> <mask> return ips, nil <mask> } </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove if ok { return true, nil } </s> add </s> remove if ok { return true, nil } </s> add </s> remove func (s *winServer) ResetLeases(leases []*Lease) { } func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) { } func (s *winServer) WriteDiskConfig6(c *V6ServerConf) { } func (s *winServer) Start() error { return nil } func (s *winServer) Stop() { } func (s *winServer) Reset() { } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add func (s *winServer) ResetLeases(leases []*Lease) {} func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() error { return nil } func (s *winServer) Stop() {} func (s *winServer) Reset() {} func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> remove func udpMatch(addr *net.UDPAddr, bound *net.UDPAddr) bool { </s> add func udpMatch(addr, bound *net.UDPAddr) bool { </s> add type netIface interface { Addrs() ([]net.Addr, error) } </s> remove func pktsExpected(got []*dhcpv4.DHCPv4, want []*dhcpv4.DHCPv4) error { </s> add func pktsExpected(got, want []*dhcpv4.DHCPv4) error {
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/v6.go
keep keep add keep keep keep keep keep
<mask> "net" <mask> "testing" <mask> <mask> "github.com/insomniacslk/dhcp/dhcpv6" <mask> "github.com/insomniacslk/dhcp/iana" <mask> "github.com/stretchr/testify/assert" <mask> ) <mask> </s> Pull request: dhcpd: fix interface ipv6 check Merge in DNS/adguard-home from 2355-dhcpcheck-ipv6 to master Updates #2335. Squashed commit of the following: commit 5ce1cc7bc244ba5dd4a065d47dec8884fa3d45e7 Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 14:03:24 2020 +0300 dhcpd: fix loop exit condition commit 32b4b946bfa30159326dc295fa1a2607b78172af Author: Ainar Garipov <[email protected]> Date: Wed Nov 25 13:26:50 2020 +0300 dhcpd: fix interface ipv6 check </s> remove var ( // BroadcastMac is the broadcast MAC address. // // Any UDP packet sent to this address is broadcast on the subnet. BroadcastMac = net.HardwareAddr([]byte{255, 255, 255, 255, 255, 255}) ) </s> add // BroadcastMac is the broadcast MAC address. // // Any UDP packet sent to this address is broadcast on the subnet. var BroadcastMac = net.HardwareAddr([]byte{255, 255, 255, 255, 255, 255}) </s> remove var ( // ErrUDPAddrIsRequired is an error used when a passed argument is not of type "*net.UDPAddr". ErrUDPAddrIsRequired = errors.New("must supply UDPAddr") ) </s> add // ErrUDPAddrIsRequired is an error used when a passed argument is not of type "*net.UDPAddr". var ErrUDPAddrIsRequired = errors.New("must supply UDPAddr") </s> add type netIface interface { Addrs() ([]net.Addr, error) } </s> remove func (s *winServer) ResetLeases(leases []*Lease) { } func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) { } func (s *winServer) WriteDiskConfig6(c *V6ServerConf) { } func (s *winServer) Start() error { return nil } func (s *winServer) Stop() { } func (s *winServer) Reset() { } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add func (s *winServer) ResetLeases(leases []*Lease) {} func (s *winServer) GetLeases(flags int) []Lease { return nil } func (s *winServer) GetLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(lease Lease) error { return nil } func (s *winServer) RemoveStaticLease(l Lease) error { return nil } func (s *winServer) FindMACbyIP(ip net.IP) net.HardwareAddr { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() error { return nil } func (s *winServer) Stop() {} func (s *winServer) Reset() {} func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> remove func udp4pkt(packet []byte, dest *net.UDPAddr, src *net.UDPAddr) []byte { </s> add func udp4pkt(packet []byte, dest, src *net.UDPAddr) []byte { </s> remove func PseudoHeaderChecksum(protocol TransportProtocolNumber, srcAddr net.IP, dstAddr net.IP) uint16 { </s> add func PseudoHeaderChecksum(protocol TransportProtocolNumber, srcAddr, dstAddr net.IP) uint16 {
https://github.com/AdguardTeam/AdGuardHome/commit/36c7735b855f4388d0cf36fb2f26f1979809c217
internal/dhcpd/v6_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> ) { <mask> pctx := ctx.proxyCtx <mask> e := stats.Entry{} <mask> e.Domain = strings.ToLower(pctx.Req.Question[0].Name) <mask> e.Domain = e.Domain[:len(e.Domain)-1] // remove last "." <mask> <mask> if clientID := ctx.clientID; clientID != "" { <mask> e.Client = clientID <mask> } else { <mask> e.Client = clientIP </s> Pull request: dnsforward: stat empty queries Merge in DNS/adguard-home from 5910-stats-malformed-entry to master Squashed commit of the following: commit ea6718daf0d65dc4b13cd08430da7fdeb6f7fd5b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 17:34:50 2023 +0400 all: imp docs commit 5341c5b351c87556b91a7f692960edc76f44b21a Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:47:13 2023 +0400 all: docs commit 1703c421f501484a80ddcf4ca1ba24f71fa5d225 Merge: f56b62490 d26c480d0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:46:13 2023 +0400 Merge remote-tracking branch 'origin/master' into 5910-stats-malformed-entry # Conflicts: # CHANGELOG.md commit f56b62490c7033e1d0b620a9cb4ba8de64862de0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:49:43 2023 +0400 all: docs commit be954a8cab950d038c8cf08b95158069fa0747ba Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:44:05 2023 +0400 querylog: empty queries commit 0cda309d402156e750c7387e471da6795aa43bd6 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:26:41 2023 +0400 dnsforward: stat empty queries </s> add qHost := q.Name if qHost != "." { qHost = strings.ToLower(q.Name[:len(q.Name)-1]) } </s> add if e.Domain == "" { return } </s> remove func TestProcessQueryLogsAndStats(t *testing.T) { </s> add func TestServer_ProcessQueryLogsAndStats(t *testing.T) { const domain = "example.com." </s> add domain string </s> remove Name: "example.com.", </s> add Name: tc.domain, </s> remove Time: time.Now(), QHost: strings.ToLower(q.Name[:len(q.Name)-1]), </s> add Time: time.Now(), QHost: qHost,
https://github.com/AdguardTeam/AdGuardHome/commit/371261b2c66a0b9b64c8c3e2262eb11b982b8572
internal/dnsforward/stats.go
keep keep keep add keep keep keep keep keep keep
<mask> } <mask> <mask> // Update implements the [stats.Interface] interface for *testStats. <mask> func (l *testStats) Update(e stats.Entry) { <mask> l.lastEntry = e <mask> } <mask> <mask> // ShouldCount implements the [stats.Interface] interface for *testStats. <mask> func (l *testStats) ShouldCount(string, uint16, uint16, []string) bool { <mask> return true </s> Pull request: dnsforward: stat empty queries Merge in DNS/adguard-home from 5910-stats-malformed-entry to master Squashed commit of the following: commit ea6718daf0d65dc4b13cd08430da7fdeb6f7fd5b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 17:34:50 2023 +0400 all: imp docs commit 5341c5b351c87556b91a7f692960edc76f44b21a Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:47:13 2023 +0400 all: docs commit 1703c421f501484a80ddcf4ca1ba24f71fa5d225 Merge: f56b62490 d26c480d0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:46:13 2023 +0400 Merge remote-tracking branch 'origin/master' into 5910-stats-malformed-entry # Conflicts: # CHANGELOG.md commit f56b62490c7033e1d0b620a9cb4ba8de64862de0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:49:43 2023 +0400 all: docs commit be954a8cab950d038c8cf08b95158069fa0747ba Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:44:05 2023 +0400 querylog: empty queries commit 0cda309d402156e750c7387e471da6795aa43bd6 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:26:41 2023 +0400 dnsforward: stat empty queries </s> remove func TestProcessQueryLogsAndStats(t *testing.T) { </s> add func TestServer_ProcessQueryLogsAndStats(t *testing.T) { const domain = "example.com." </s> remove e.Domain = e.Domain[:len(e.Domain)-1] // remove last "." </s> add if e.Domain != "." { // Remove last ".", but save the domain as is for "." queries. e.Domain = e.Domain[:len(e.Domain)-1] } </s> add qHost := q.Name if qHost != "." { qHost = strings.ToLower(q.Name[:len(q.Name)-1]) } </s> remove Time: time.Now(), QHost: strings.ToLower(q.Name[:len(q.Name)-1]), </s> add Time: time.Now(), QHost: qHost, </s> remove Name: "example.com.", </s> add Name: tc.domain, </s> add }, { name: "success_udp_pc_empty_fqdn", domain: ".", proto: proxy.ProtoUDP, addr: &net.UDPAddr{IP: net.IP{1, 2, 3, 5}, Port: 1234}, clientID: "", wantLogProto: "", wantStatClient: "1.2.3.5", wantCode: resultCodeSuccess, reason: filtering.FilteredParental, wantStatResult: stats.RParental,
https://github.com/AdguardTeam/AdGuardHome/commit/371261b2c66a0b9b64c8c3e2262eb11b982b8572
internal/dnsforward/stats_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> func (l *testStats) ShouldCount(string, uint16, uint16, []string) bool { <mask> return true <mask> } <mask> <mask> func TestProcessQueryLogsAndStats(t *testing.T) { <mask> testCases := []struct { <mask> name string <mask> proto proxy.Proto <mask> addr net.Addr <mask> clientID string </s> Pull request: dnsforward: stat empty queries Merge in DNS/adguard-home from 5910-stats-malformed-entry to master Squashed commit of the following: commit ea6718daf0d65dc4b13cd08430da7fdeb6f7fd5b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 17:34:50 2023 +0400 all: imp docs commit 5341c5b351c87556b91a7f692960edc76f44b21a Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:47:13 2023 +0400 all: docs commit 1703c421f501484a80ddcf4ca1ba24f71fa5d225 Merge: f56b62490 d26c480d0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:46:13 2023 +0400 Merge remote-tracking branch 'origin/master' into 5910-stats-malformed-entry # Conflicts: # CHANGELOG.md commit f56b62490c7033e1d0b620a9cb4ba8de64862de0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:49:43 2023 +0400 all: docs commit be954a8cab950d038c8cf08b95158069fa0747ba Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:44:05 2023 +0400 querylog: empty queries commit 0cda309d402156e750c7387e471da6795aa43bd6 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:26:41 2023 +0400 dnsforward: stat empty queries </s> add domain string </s> add if e.Domain == "" { return } </s> add qHost := q.Name if qHost != "." { qHost = strings.ToLower(q.Name[:len(q.Name)-1]) } </s> remove e.Domain = e.Domain[:len(e.Domain)-1] // remove last "." </s> add if e.Domain != "." { // Remove last ".", but save the domain as is for "." queries. e.Domain = e.Domain[:len(e.Domain)-1] } </s> remove Name: "example.com.", </s> add Name: tc.domain, </s> add addEntry(l, "", net.IPv4(1, 1, 1, 5), net.IPv4(2, 2, 2, 5))
https://github.com/AdguardTeam/AdGuardHome/commit/371261b2c66a0b9b64c8c3e2262eb11b982b8572
internal/dnsforward/stats_test.go
keep add keep keep keep keep
<mask> testCases := []struct { <mask> name string <mask> proto proxy.Proto <mask> addr net.Addr <mask> clientID string <mask> wantLogProto querylog.ClientProto </s> Pull request: dnsforward: stat empty queries Merge in DNS/adguard-home from 5910-stats-malformed-entry to master Squashed commit of the following: commit ea6718daf0d65dc4b13cd08430da7fdeb6f7fd5b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 17:34:50 2023 +0400 all: imp docs commit 5341c5b351c87556b91a7f692960edc76f44b21a Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:47:13 2023 +0400 all: docs commit 1703c421f501484a80ddcf4ca1ba24f71fa5d225 Merge: f56b62490 d26c480d0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:46:13 2023 +0400 Merge remote-tracking branch 'origin/master' into 5910-stats-malformed-entry # Conflicts: # CHANGELOG.md commit f56b62490c7033e1d0b620a9cb4ba8de64862de0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:49:43 2023 +0400 all: docs commit be954a8cab950d038c8cf08b95158069fa0747ba Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:44:05 2023 +0400 querylog: empty queries commit 0cda309d402156e750c7387e471da6795aa43bd6 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:26:41 2023 +0400 dnsforward: stat empty queries </s> remove func TestProcessQueryLogsAndStats(t *testing.T) { </s> add func TestServer_ProcessQueryLogsAndStats(t *testing.T) { const domain = "example.com." </s> remove e.Domain = e.Domain[:len(e.Domain)-1] // remove last "." </s> add if e.Domain != "." { // Remove last ".", but save the domain as is for "." queries. e.Domain = e.Domain[:len(e.Domain)-1] } </s> add addEntry(l, "", net.IPv4(1, 1, 1, 5), net.IPv4(2, 2, 2, 5)) </s> add }, { name: "success_udp_pc_empty_fqdn", domain: ".", proto: proxy.ProtoUDP, addr: &net.UDPAddr{IP: net.IP{1, 2, 3, 5}, Port: 1234}, clientID: "", wantLogProto: "", wantStatClient: "1.2.3.5", wantCode: resultCodeSuccess, reason: filtering.FilteredParental, wantStatResult: stats.RParental, </s> add qHost := q.Name if qHost != "." { qHost = strings.ToLower(q.Name[:len(q.Name)-1]) } </s> remove Name: "example.com.", </s> add Name: tc.domain,
https://github.com/AdguardTeam/AdGuardHome/commit/371261b2c66a0b9b64c8c3e2262eb11b982b8572
internal/dnsforward/stats_test.go
keep keep keep add keep keep keep keep keep
<mask> reason filtering.Reason <mask> wantStatResult stats.Result <mask> }{{ <mask> name: "success_udp", <mask> proto: proxy.ProtoUDP, <mask> addr: &net.UDPAddr{IP: net.IP{1, 2, 3, 4}, Port: 1234}, <mask> clientID: "", <mask> wantLogProto: "", <mask> wantStatClient: "1.2.3.4", </s> Pull request: dnsforward: stat empty queries Merge in DNS/adguard-home from 5910-stats-malformed-entry to master Squashed commit of the following: commit ea6718daf0d65dc4b13cd08430da7fdeb6f7fd5b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 17:34:50 2023 +0400 all: imp docs commit 5341c5b351c87556b91a7f692960edc76f44b21a Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:47:13 2023 +0400 all: docs commit 1703c421f501484a80ddcf4ca1ba24f71fa5d225 Merge: f56b62490 d26c480d0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:46:13 2023 +0400 Merge remote-tracking branch 'origin/master' into 5910-stats-malformed-entry # Conflicts: # CHANGELOG.md commit f56b62490c7033e1d0b620a9cb4ba8de64862de0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:49:43 2023 +0400 all: docs commit be954a8cab950d038c8cf08b95158069fa0747ba Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:44:05 2023 +0400 querylog: empty queries commit 0cda309d402156e750c7387e471da6795aa43bd6 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:26:41 2023 +0400 dnsforward: stat empty queries </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain,
https://github.com/AdguardTeam/AdGuardHome/commit/371261b2c66a0b9b64c8c3e2262eb11b982b8572
internal/dnsforward/stats_test.go
keep keep keep add keep keep keep keep keep
<mask> reason: filtering.NotFilteredNotFound, <mask> wantStatResult: stats.RNotFiltered, <mask> }, { <mask> name: "success_tls_clientid", <mask> proto: proxy.ProtoTLS, <mask> addr: &net.TCPAddr{IP: net.IP{1, 2, 3, 4}, Port: 1234}, <mask> clientID: "cli42", <mask> wantLogProto: querylog.ClientProtoDoT, <mask> wantStatClient: "cli42", </s> Pull request: dnsforward: stat empty queries Merge in DNS/adguard-home from 5910-stats-malformed-entry to master Squashed commit of the following: commit ea6718daf0d65dc4b13cd08430da7fdeb6f7fd5b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 17:34:50 2023 +0400 all: imp docs commit 5341c5b351c87556b91a7f692960edc76f44b21a Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:47:13 2023 +0400 all: docs commit 1703c421f501484a80ddcf4ca1ba24f71fa5d225 Merge: f56b62490 d26c480d0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:46:13 2023 +0400 Merge remote-tracking branch 'origin/master' into 5910-stats-malformed-entry # Conflicts: # CHANGELOG.md commit f56b62490c7033e1d0b620a9cb4ba8de64862de0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:49:43 2023 +0400 all: docs commit be954a8cab950d038c8cf08b95158069fa0747ba Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:44:05 2023 +0400 querylog: empty queries commit 0cda309d402156e750c7387e471da6795aa43bd6 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:26:41 2023 +0400 dnsforward: stat empty queries </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain,
https://github.com/AdguardTeam/AdGuardHome/commit/371261b2c66a0b9b64c8c3e2262eb11b982b8572
internal/dnsforward/stats_test.go
keep keep keep add keep keep keep keep
<mask> reason: filtering.NotFilteredNotFound, <mask> wantStatResult: stats.RNotFiltered, <mask> }, { <mask> name: "success_tls", <mask> proto: proxy.ProtoTLS, <mask> addr: &net.TCPAddr{IP: net.IP{1, 2, 3, 4}, Port: 1234}, <mask> clientID: "", <mask> wantLogProto: querylog.ClientProtoDoT, </s> Pull request: dnsforward: stat empty queries Merge in DNS/adguard-home from 5910-stats-malformed-entry to master Squashed commit of the following: commit ea6718daf0d65dc4b13cd08430da7fdeb6f7fd5b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 17:34:50 2023 +0400 all: imp docs commit 5341c5b351c87556b91a7f692960edc76f44b21a Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:47:13 2023 +0400 all: docs commit 1703c421f501484a80ddcf4ca1ba24f71fa5d225 Merge: f56b62490 d26c480d0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:46:13 2023 +0400 Merge remote-tracking branch 'origin/master' into 5910-stats-malformed-entry # Conflicts: # CHANGELOG.md commit f56b62490c7033e1d0b620a9cb4ba8de64862de0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:49:43 2023 +0400 all: docs commit be954a8cab950d038c8cf08b95158069fa0747ba Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:44:05 2023 +0400 querylog: empty queries commit 0cda309d402156e750c7387e471da6795aa43bd6 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:26:41 2023 +0400 dnsforward: stat empty queries </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain,
https://github.com/AdguardTeam/AdGuardHome/commit/371261b2c66a0b9b64c8c3e2262eb11b982b8572
internal/dnsforward/stats_test.go
keep keep keep add keep keep keep keep keep
<mask> reason: filtering.NotFilteredNotFound, <mask> wantStatResult: stats.RNotFiltered, <mask> }, { <mask> name: "success_quic", <mask> proto: proxy.ProtoQUIC, <mask> addr: &net.UDPAddr{IP: net.IP{1, 2, 3, 4}, Port: 1234}, <mask> clientID: "", <mask> wantLogProto: querylog.ClientProtoDoQ, <mask> wantStatClient: "1.2.3.4", </s> Pull request: dnsforward: stat empty queries Merge in DNS/adguard-home from 5910-stats-malformed-entry to master Squashed commit of the following: commit ea6718daf0d65dc4b13cd08430da7fdeb6f7fd5b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 17:34:50 2023 +0400 all: imp docs commit 5341c5b351c87556b91a7f692960edc76f44b21a Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:47:13 2023 +0400 all: docs commit 1703c421f501484a80ddcf4ca1ba24f71fa5d225 Merge: f56b62490 d26c480d0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:46:13 2023 +0400 Merge remote-tracking branch 'origin/master' into 5910-stats-malformed-entry # Conflicts: # CHANGELOG.md commit f56b62490c7033e1d0b620a9cb4ba8de64862de0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:49:43 2023 +0400 all: docs commit be954a8cab950d038c8cf08b95158069fa0747ba Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:44:05 2023 +0400 querylog: empty queries commit 0cda309d402156e750c7387e471da6795aa43bd6 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:26:41 2023 +0400 dnsforward: stat empty queries </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain,
https://github.com/AdguardTeam/AdGuardHome/commit/371261b2c66a0b9b64c8c3e2262eb11b982b8572
internal/dnsforward/stats_test.go
keep keep add keep keep keep keep keep
<mask> wantStatResult: stats.RNotFiltered, <mask> }, { <mask> name: "success_https", <mask> proto: proxy.ProtoHTTPS, <mask> addr: &net.TCPAddr{IP: net.IP{1, 2, 3, 4}, Port: 1234}, <mask> clientID: "", <mask> wantLogProto: querylog.ClientProtoDoH, <mask> wantStatClient: "1.2.3.4", </s> Pull request: dnsforward: stat empty queries Merge in DNS/adguard-home from 5910-stats-malformed-entry to master Squashed commit of the following: commit ea6718daf0d65dc4b13cd08430da7fdeb6f7fd5b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 17:34:50 2023 +0400 all: imp docs commit 5341c5b351c87556b91a7f692960edc76f44b21a Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:47:13 2023 +0400 all: docs commit 1703c421f501484a80ddcf4ca1ba24f71fa5d225 Merge: f56b62490 d26c480d0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:46:13 2023 +0400 Merge remote-tracking branch 'origin/master' into 5910-stats-malformed-entry # Conflicts: # CHANGELOG.md commit f56b62490c7033e1d0b620a9cb4ba8de64862de0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:49:43 2023 +0400 all: docs commit be954a8cab950d038c8cf08b95158069fa0747ba Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:44:05 2023 +0400 querylog: empty queries commit 0cda309d402156e750c7387e471da6795aa43bd6 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:26:41 2023 +0400 dnsforward: stat empty queries </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain,
https://github.com/AdguardTeam/AdGuardHome/commit/371261b2c66a0b9b64c8c3e2262eb11b982b8572
internal/dnsforward/stats_test.go
keep keep add keep keep keep keep keep
<mask> wantStatResult: stats.RNotFiltered, <mask> }, { <mask> name: "success_dnscrypt", <mask> proto: proxy.ProtoDNSCrypt, <mask> addr: &net.TCPAddr{IP: net.IP{1, 2, 3, 4}, Port: 1234}, <mask> clientID: "", <mask> wantLogProto: querylog.ClientProtoDNSCrypt, <mask> wantStatClient: "1.2.3.4", </s> Pull request: dnsforward: stat empty queries Merge in DNS/adguard-home from 5910-stats-malformed-entry to master Squashed commit of the following: commit ea6718daf0d65dc4b13cd08430da7fdeb6f7fd5b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 17:34:50 2023 +0400 all: imp docs commit 5341c5b351c87556b91a7f692960edc76f44b21a Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:47:13 2023 +0400 all: docs commit 1703c421f501484a80ddcf4ca1ba24f71fa5d225 Merge: f56b62490 d26c480d0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:46:13 2023 +0400 Merge remote-tracking branch 'origin/master' into 5910-stats-malformed-entry # Conflicts: # CHANGELOG.md commit f56b62490c7033e1d0b620a9cb4ba8de64862de0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:49:43 2023 +0400 all: docs commit be954a8cab950d038c8cf08b95158069fa0747ba Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:44:05 2023 +0400 querylog: empty queries commit 0cda309d402156e750c7387e471da6795aa43bd6 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:26:41 2023 +0400 dnsforward: stat empty queries </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain,
https://github.com/AdguardTeam/AdGuardHome/commit/371261b2c66a0b9b64c8c3e2262eb11b982b8572
internal/dnsforward/stats_test.go
keep keep keep add keep keep keep keep keep
<mask> reason: filtering.NotFilteredNotFound, <mask> wantStatResult: stats.RNotFiltered, <mask> }, { <mask> name: "success_udp_filtered", <mask> proto: proxy.ProtoUDP, <mask> addr: &net.UDPAddr{IP: net.IP{1, 2, 3, 4}, Port: 1234}, <mask> clientID: "", <mask> wantLogProto: "", <mask> wantStatClient: "1.2.3.4", </s> Pull request: dnsforward: stat empty queries Merge in DNS/adguard-home from 5910-stats-malformed-entry to master Squashed commit of the following: commit ea6718daf0d65dc4b13cd08430da7fdeb6f7fd5b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 17:34:50 2023 +0400 all: imp docs commit 5341c5b351c87556b91a7f692960edc76f44b21a Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:47:13 2023 +0400 all: docs commit 1703c421f501484a80ddcf4ca1ba24f71fa5d225 Merge: f56b62490 d26c480d0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 16:46:13 2023 +0400 Merge remote-tracking branch 'origin/master' into 5910-stats-malformed-entry # Conflicts: # CHANGELOG.md commit f56b62490c7033e1d0b620a9cb4ba8de64862de0 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:49:43 2023 +0400 all: docs commit be954a8cab950d038c8cf08b95158069fa0747ba Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:44:05 2023 +0400 querylog: empty queries commit 0cda309d402156e750c7387e471da6795aa43bd6 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 19 14:26:41 2023 +0400 dnsforward: stat empty queries </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain, </s> add domain: domain,
https://github.com/AdguardTeam/AdGuardHome/commit/371261b2c66a0b9b64c8c3e2262eb11b982b8572
internal/dnsforward/stats_test.go