docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
return f.Name() }
<mask> for i := 0; i < linesNum; i++ { <mask> lineIP++ <mask> lineTime = lineTime.Add(time.Second) <mask> <mask> ip := make(net.IP, 4) <mask> binary.BigEndian.PutUint32(ip, lineIP) <mask> <mask> line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) <mask> <mask> _, err = f.WriteString(line) <mask> require.Nil(t, err) </s> Pull request: all: fix windows tempdir Merge in DNS/adguard-home from try-fixing-windows-tests to master Squashed commit of the following: commit 25a43db5d53f24b98921efa21d8d2f231992e761 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 26 21:19:00 2021 +0300 all: fix windows tempdir </s> remove for i := 0; i < linesNum; i++ { lineIP++ lineTime = lineTime.Add(time.Second) </s> add _, err = f.WriteString(line) require.NoError(t, err) } </s> remove files := make([]string, filesNum) for j := range files { f, err := ioutil.TempFile(dir, "*.txt") require.Nil(t, err) files[filesNum-j-1] = f.Name() </s> add line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) </s> remove line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) </s> add // prepareTestFiles prepares several test query log files, each with the // specified lines count. func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string { t.Helper() </s> remove _, err = f.WriteString(line) require.Nil(t, err) } </s> add if filesNum == 0 { return []string{} </s> remove lineTime, _ := time.Parse(time.RFC3339Nano, "2020-02-18T22:36:35.920973+03:00") lineIP := uint32(0) </s> add var lineIP uint32 lineTime := time.Date(2020, 2, 18, 19, 36, 35, 920973000, time.UTC) for i := 0; i < linesNum; i++ { lineIP++ lineTime = lineTime.Add(time.Second)
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca
internal/querylog/qlogfile_test.go
// prepareTestFiles prepares several test query log files, each with the // specified lines count. func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string { t.Helper()
<mask> <mask> ip := make(net.IP, 4) <mask> binary.BigEndian.PutUint32(ip, lineIP) <mask> <mask> line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) <mask> <mask> _, err = f.WriteString(line) <mask> require.Nil(t, err) <mask> } <mask> } </s> Pull request: all: fix windows tempdir Merge in DNS/adguard-home from try-fixing-windows-tests to master Squashed commit of the following: commit 25a43db5d53f24b98921efa21d8d2f231992e761 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 26 21:19:00 2021 +0300 all: fix windows tempdir </s> remove ip := make(net.IP, 4) binary.BigEndian.PutUint32(ip, lineIP) </s> add return f.Name() } </s> remove for i := 0; i < linesNum; i++ { lineIP++ lineTime = lineTime.Add(time.Second) </s> add _, err = f.WriteString(line) require.NoError(t, err) } </s> remove _, err = f.WriteString(line) require.Nil(t, err) } </s> add if filesNum == 0 { return []string{} </s> remove dir := aghtest.PrepareTestDir(t) </s> add ip := make(net.IP, 4) binary.BigEndian.PutUint32(ip, lineIP) </s> remove files := make([]string, filesNum) for j := range files { f, err := ioutil.TempFile(dir, "*.txt") require.Nil(t, err) files[filesNum-j-1] = f.Name() </s> add line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano))
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca
internal/querylog/qlogfile_test.go
if filesNum == 0 { return []string{}
<mask> binary.BigEndian.PutUint32(ip, lineIP) <mask> <mask> line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) <mask> <mask> _, err = f.WriteString(line) <mask> require.Nil(t, err) <mask> } <mask> } <mask> <mask> return files <mask> } <mask> </s> Pull request: all: fix windows tempdir Merge in DNS/adguard-home from try-fixing-windows-tests to master Squashed commit of the following: commit 25a43db5d53f24b98921efa21d8d2f231992e761 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 26 21:19:00 2021 +0300 all: fix windows tempdir </s> remove ip := make(net.IP, 4) binary.BigEndian.PutUint32(ip, lineIP) </s> add return f.Name() } </s> remove for i := 0; i < linesNum; i++ { lineIP++ lineTime = lineTime.Add(time.Second) </s> add _, err = f.WriteString(line) require.NoError(t, err) } </s> remove line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) </s> add // prepareTestFiles prepares several test query log files, each with the // specified lines count. func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string { t.Helper() </s> remove files := make([]string, filesNum) for j := range files { f, err := ioutil.TempFile(dir, "*.txt") require.Nil(t, err) files[filesNum-j-1] = f.Name() </s> add line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) </s> remove dir := aghtest.PrepareTestDir(t) </s> add ip := make(net.IP, 4) binary.BigEndian.PutUint32(ip, lineIP)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca
internal/querylog/qlogfile_test.go
dir := t.TempDir()
<mask> require.Nil(t, err) <mask> } <mask> } <mask> <mask> return files <mask> } <mask> <mask> // prepareTestFile prepares a test query log file with the specified number of <mask> // lines. <mask> func prepareTestFile(t *testing.T, linesCount int) string { <mask> t.Helper() </s> Pull request: all: fix windows tempdir Merge in DNS/adguard-home from try-fixing-windows-tests to master Squashed commit of the following: commit 25a43db5d53f24b98921efa21d8d2f231992e761 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 26 21:19:00 2021 +0300 all: fix windows tempdir </s> remove // prepareTestFile prepares a test query log file with the specified number of // lines. func prepareTestFile(t *testing.T, linesCount int) string { t.Helper() </s> add files := make([]string, filesNum) for i := range files { files[filesNum-i-1] = prepareTestFile(t, dir, linesNum) } </s> remove // prepareTestFiles prepares several test query log files, each with the // specified lines count. func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string { </s> add // prepareTestFile prepares one test query log file with the specified lines // count. func prepareTestFile(t *testing.T, dir string, linesNum int) (name string) { </s> remove return prepareTestFiles(t, 1, linesCount)[0] </s> add return files </s> remove line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) </s> add // prepareTestFiles prepares several test query log files, each with the // specified lines count. func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string { t.Helper() </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest" </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca
internal/querylog/qlogfile_test.go
files := make([]string, filesNum) for i := range files { files[filesNum-i-1] = prepareTestFile(t, dir, linesNum) }
<mask> <mask> return files <mask> } <mask> <mask> // prepareTestFile prepares a test query log file with the specified number of <mask> // lines. <mask> func prepareTestFile(t *testing.T, linesCount int) string { <mask> t.Helper() <mask> <mask> return prepareTestFiles(t, 1, linesCount)[0] <mask> } <mask> <mask> // newTestQLogFile creates new *QLogFile for tests and registers the required </s> Pull request: all: fix windows tempdir Merge in DNS/adguard-home from try-fixing-windows-tests to master Squashed commit of the following: commit 25a43db5d53f24b98921efa21d8d2f231992e761 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 26 21:19:00 2021 +0300 all: fix windows tempdir </s> remove return prepareTestFiles(t, 1, linesCount)[0] </s> add return files </s> remove return files } </s> add dir := t.TempDir() </s> remove // prepareTestFiles prepares several test query log files, each with the // specified lines count. func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string { </s> add // prepareTestFile prepares one test query log file with the specified lines // count. func prepareTestFile(t *testing.T, dir string, linesNum int) (name string) { </s> remove line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) </s> add // prepareTestFiles prepares several test query log files, each with the // specified lines count. func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string { t.Helper() </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest" </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca
internal/querylog/qlogfile_test.go
return files
<mask> // lines. <mask> func prepareTestFile(t *testing.T, linesCount int) string { <mask> t.Helper() <mask> <mask> return prepareTestFiles(t, 1, linesCount)[0] <mask> } <mask> <mask> // newTestQLogFile creates new *QLogFile for tests and registers the required <mask> // cleanup functions. <mask> func newTestQLogFile(t *testing.T, linesNum int) (file *QLogFile) { </s> Pull request: all: fix windows tempdir Merge in DNS/adguard-home from try-fixing-windows-tests to master Squashed commit of the following: commit 25a43db5d53f24b98921efa21d8d2f231992e761 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 26 21:19:00 2021 +0300 all: fix windows tempdir </s> remove // prepareTestFile prepares a test query log file with the specified number of // lines. func prepareTestFile(t *testing.T, linesCount int) string { t.Helper() </s> add files := make([]string, filesNum) for i := range files { files[filesNum-i-1] = prepareTestFile(t, dir, linesNum) } </s> remove testFile := prepareTestFile(t, linesNum) </s> add testFile := prepareTestFiles(t, 1, linesNum)[0] </s> remove return files } </s> add dir := t.TempDir() </s> remove // prepareTestFiles prepares several test query log files, each with the // specified lines count. func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string { </s> add // prepareTestFile prepares one test query log file with the specified lines // count. func prepareTestFile(t *testing.T, dir string, linesNum int) (name string) { </s> remove f, err := ioutil.TempFile(aghtest.PrepareTestDir(t), "*.txt") </s> add f, err := ioutil.TempFile(t.TempDir(), "*.txt")
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca
internal/querylog/qlogfile_test.go
testFile := prepareTestFiles(t, 1, linesNum)[0]
<mask> // cleanup functions. <mask> func newTestQLogFile(t *testing.T, linesNum int) (file *QLogFile) { <mask> t.Helper() <mask> <mask> testFile := prepareTestFile(t, linesNum) <mask> <mask> // Create the new QLogFile instance. <mask> file, err := NewQLogFile(testFile) <mask> require.Nil(t, err) <mask> assert.NotNil(t, file) </s> Pull request: all: fix windows tempdir Merge in DNS/adguard-home from try-fixing-windows-tests to master Squashed commit of the following: commit 25a43db5d53f24b98921efa21d8d2f231992e761 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 26 21:19:00 2021 +0300 all: fix windows tempdir </s> remove return prepareTestFiles(t, 1, linesCount)[0] </s> add return files </s> remove // prepareTestFile prepares a test query log file with the specified number of // lines. func prepareTestFile(t *testing.T, linesCount int) string { t.Helper() </s> add files := make([]string, filesNum) for i := range files { files[filesNum-i-1] = prepareTestFile(t, dir, linesNum) } </s> remove f, err := ioutil.TempFile(aghtest.PrepareTestDir(t), "*.txt") </s> add f, err := ioutil.TempFile(t.TempDir(), "*.txt") </s> remove line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) </s> add // prepareTestFiles prepares several test query log files, each with the // specified lines count. func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string { t.Helper() </s> remove return files } </s> add dir := t.TempDir()
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca
internal/querylog/qlogfile_test.go
f, err := ioutil.TempFile(t.TempDir(), "*.txt")
<mask> assert.Empty(t, line) <mask> } <mask> <mask> func NewTestQLogFileData(t *testing.T, data string) (file *QLogFile) { <mask> f, err := ioutil.TempFile(aghtest.PrepareTestDir(t), "*.txt") <mask> require.Nil(t, err) <mask> t.Cleanup(func() { <mask> assert.Nil(t, f.Close()) <mask> }) <mask> </s> Pull request: all: fix windows tempdir Merge in DNS/adguard-home from try-fixing-windows-tests to master Squashed commit of the following: commit 25a43db5d53f24b98921efa21d8d2f231992e761 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 26 21:19:00 2021 +0300 all: fix windows tempdir </s> remove dir := aghtest.PrepareTestDir(t) </s> add dir := t.TempDir() </s> remove testFile := prepareTestFile(t, linesNum) </s> add testFile := prepareTestFiles(t, 1, linesNum)[0] </s> remove wd := aghtest.PrepareTestDir(t) </s> add wd := t.TempDir() </s> remove return prepareTestFiles(t, 1, linesCount)[0] </s> add return files </s> remove for i := 0; i < linesNum; i++ { lineIP++ lineTime = lineTime.Add(time.Second) </s> add _, err = f.WriteString(line) require.NoError(t, err) }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca
internal/querylog/qlogfile_test.go
wd := t.TempDir()
<mask> assert.Nil(t, err) <mask> } <mask> <mask> func TestUpdate(t *testing.T) { <mask> wd := aghtest.PrepareTestDir(t) <mask> <mask> assert.Nil(t, ioutil.WriteFile(filepath.Join(wd, "AdGuardHome"), []byte("AdGuardHome"), 0o755)) <mask> assert.Nil(t, ioutil.WriteFile(filepath.Join(wd, "README.md"), []byte("README.md"), 0o644)) <mask> assert.Nil(t, ioutil.WriteFile(filepath.Join(wd, "LICENSE.txt"), []byte("LICENSE.txt"), 0o644)) <mask> assert.Nil(t, ioutil.WriteFile(filepath.Join(wd, "AdGuardHome.yaml"), []byte("AdGuardHome.yaml"), 0o644)) </s> Pull request: all: fix windows tempdir Merge in DNS/adguard-home from try-fixing-windows-tests to master Squashed commit of the following: commit 25a43db5d53f24b98921efa21d8d2f231992e761 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 26 21:19:00 2021 +0300 all: fix windows tempdir </s> remove wd := aghtest.PrepareTestDir(t) </s> add wd := t.TempDir() </s> remove f, err := ioutil.TempFile(aghtest.PrepareTestDir(t), "*.txt") </s> add f, err := ioutil.TempFile(t.TempDir(), "*.txt") </s> remove dir := aghtest.PrepareTestDir(t) </s> add dir := t.TempDir() </s> remove dir := aghtest.PrepareTestDir(t) </s> add ip := make(net.IP, 4) binary.BigEndian.PutUint32(ip, lineIP) </s> remove files := make([]string, filesNum) for j := range files { f, err := ioutil.TempFile(dir, "*.txt") require.Nil(t, err) files[filesNum-j-1] = f.Name() </s> add line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano))
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca
internal/updater/updater_test.go
wd := t.TempDir()
<mask> assert.Equal(t, "AdGuardHome.yaml", string(d)) <mask> } <mask> <mask> func TestUpdateWindows(t *testing.T) { <mask> wd := aghtest.PrepareTestDir(t) <mask> <mask> assert.Nil(t, ioutil.WriteFile(filepath.Join(wd, "AdGuardHome.exe"), []byte("AdGuardHome.exe"), 0o755)) <mask> assert.Nil(t, ioutil.WriteFile(filepath.Join(wd, "README.md"), []byte("README.md"), 0o644)) <mask> assert.Nil(t, ioutil.WriteFile(filepath.Join(wd, "LICENSE.txt"), []byte("LICENSE.txt"), 0o644)) <mask> assert.Nil(t, ioutil.WriteFile(filepath.Join(wd, "AdGuardHome.yaml"), []byte("AdGuardHome.yaml"), 0o644)) </s> Pull request: all: fix windows tempdir Merge in DNS/adguard-home from try-fixing-windows-tests to master Squashed commit of the following: commit 25a43db5d53f24b98921efa21d8d2f231992e761 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 26 21:19:00 2021 +0300 all: fix windows tempdir </s> remove wd := aghtest.PrepareTestDir(t) </s> add wd := t.TempDir() </s> remove f, err := ioutil.TempFile(aghtest.PrepareTestDir(t), "*.txt") </s> add f, err := ioutil.TempFile(t.TempDir(), "*.txt") </s> remove dir := aghtest.PrepareTestDir(t) </s> add dir := t.TempDir() </s> remove files := make([]string, filesNum) for j := range files { f, err := ioutil.TempFile(dir, "*.txt") require.Nil(t, err) files[filesNum-j-1] = f.Name() </s> add line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) </s> remove dir := aghtest.PrepareTestDir(t) </s> add ip := make(net.IP, 4) binary.BigEndian.PutUint32(ip, lineIP)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca
internal/updater/updater_test.go
dir := t.TempDir()
<mask> <mask> func prepareTestFile(t *testing.T) (f *os.File) { <mask> t.Helper() <mask> <mask> dir := aghtest.PrepareTestDir(t) <mask> <mask> f, err := ioutil.TempFile(dir, "") <mask> require.Nil(t, err) <mask> require.NotNil(t, f) <mask> t.Cleanup(func() { </s> Pull request: all: fix windows tempdir Merge in DNS/adguard-home from try-fixing-windows-tests to master Squashed commit of the following: commit 25a43db5d53f24b98921efa21d8d2f231992e761 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 26 21:19:00 2021 +0300 all: fix windows tempdir </s> remove f, err := ioutil.TempFile(aghtest.PrepareTestDir(t), "*.txt") </s> add f, err := ioutil.TempFile(t.TempDir(), "*.txt") </s> remove dir := aghtest.PrepareTestDir(t) </s> add ip := make(net.IP, 4) binary.BigEndian.PutUint32(ip, lineIP) </s> remove files := make([]string, filesNum) for j := range files { f, err := ioutil.TempFile(dir, "*.txt") require.Nil(t, err) files[filesNum-j-1] = f.Name() </s> add line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) </s> remove for i := 0; i < linesNum; i++ { lineIP++ lineTime = lineTime.Add(time.Second) </s> add _, err = f.WriteString(line) require.NoError(t, err) } </s> remove wd := aghtest.PrepareTestDir(t) </s> add wd := t.TempDir()
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca
internal/util/autohosts_test.go
// options to allow broadcasting, it also binds the connection to a specific // interface. On FreeBSD and OpenBSD net.UDPConn.WriteTo causes errors // while writing to the addresses that belong to another interface. So, use // the broadcast address specific for the interface bound.
<mask> <mask> // broadcast sends resp to the broadcast address specific for network interface. <mask> func (c *dhcpConn) broadcast(respData []byte, peer *net.UDPAddr) (n int, err error) { <mask> // Despite the fact that server4.NewIPv4UDPConn explicitly sets socket <mask> // options to allow broadcasting, it also binds the connection to a <mask> // specific interface. On FreeBSD and OpenBSD net.UDPConn.WriteTo <mask> // causes errors while writing to the addresses that belong to another <mask> // interface. So, use the broadcast address specific for the interface <mask> // bound. <mask> peer.IP = c.bcastIP <mask> <mask> return c.udpConn.WriteTo(respData, peer) <mask> } </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove dhcpv4.OptRouter(conf.subnet.IP), </s> add dhcpv4.OptRouter(s.conf.subnet.IP), </s> remove dhcpv4.OptSubnetMask(conf.subnet.Mask), </s> add dhcpv4.OptSubnetMask(s.conf.subnet.Mask), </s> remove implicit = dhcpv4.OptionsFromList( </s> add s.implicitOpts = dhcpv4.OptionsFromList( </s> remove func (s *Server) dbStore() (err error) { </s> add func (s *server) dbStore() (err error) { </s> remove // ServerInterface is an interface for servers. type ServerInterface interface { </s> add // Interface is the DHCP server that deals with both IP address families. type Interface interface { Start() (err error) Stop() (err error)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/broadcast_bsd.go
func (s *server) dbLoad() (err error) {
<mask> return ip <mask> } <mask> <mask> // Load lease table from DB <mask> func (s *Server) dbLoad() (err error) { <mask> dynLeases := []*Lease{} <mask> staticLeases := []*Lease{} <mask> v6StaticLeases := []*Lease{} <mask> v6DynLeases := []*Lease{} <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) dbStore() (err error) { </s> add func (s *server) dbStore() (err error) { </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) { </s> remove func (s *Server) Enabled() (ok bool) { </s> add func (s *server) Enabled() (ok bool) { </s> remove func (s *Server) Stop() (err error) { </s> add func (s *server) Stop() (err error) { </s> remove func (s *Server) Start() (err error) { </s> add func (s *server) Start() (err error) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/db.go
func (s *server) dbStore() (err error) {
<mask> return leases <mask> } <mask> <mask> // Store lease table in DB <mask> func (s *Server) dbStore() (err error) { <mask> // Use an empty slice here as opposed to nil so that it doesn't write <mask> // "null" into the database file if leases are empty. <mask> leases := []leaseJSON{} <mask> <mask> leases4 := s.srv4.getLeasesRef() </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) { </s> remove func (s *Server) Enabled() (ok bool) { </s> add func (s *server) Enabled() (ok bool) { </s> remove func (s *Server) dbLoad() (err error) { </s> add func (s *server) dbLoad() (err error) { </s> remove if !webHandlersRegistered && s.conf.HTTPRegister != nil { if runtime.GOOS == "windows" { // Our DHCP server doesn't work on Windows yet, so // signal that to the front with an HTTP 501. // // TODO(a.garipov): This needs refactoring. We // shouldn't even try and initialize a DHCP server on // Windows, but there are currently too many // interconnected parts--such as HTTP handlers and // frontend--to make that work properly. s.registerNotImplementedHandlers() } else { s.registerHandlers() } webHandlersRegistered = true } </s> add s.registerHandlers() </s> remove func (s *Server) FindMACbyIP(ip net.IP) net.HardwareAddr { </s> add func (s *server) FindMACbyIP(ip net.IP) net.HardwareAddr {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/db.go
<mask> "encoding/json" <mask> "fmt" <mask> "net" <mask> "path/filepath" <mask> "runtime" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" </s> add </s> remove func (s *winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (s *winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (s *winServer) getLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) FindMACbyIP(ip net.IP) (mac net.HardwareAddr) { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() (err error) { return nil } func (s *winServer) Stop() (err error) { return nil } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add // type check var _ DHCPServer = winServer{} func (winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (winServer) getLeasesRef() []*Lease { return nil } func (winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (winServer) FindMACbyIP(_ net.IP) (mac net.HardwareAddr) { return nil } func (winServer) WriteDiskConfig4(_ *V4ServerConf) {} func (winServer) WriteDiskConfig6(_ *V6ServerConf) {} func (winServer) Start() (err error) { return nil } func (winServer) Stop() (err error) { return nil } func v4Create(_ *V4ServerConf) (s DHCPServer, err error) { return winServer{}, nil } func v6Create(_ V6ServerConf) (s DHCPServer, err error) { return winServer{}, nil } </s> remove logFilePath := filepath.Join(Context.workDir, ls.File) if filepath.IsAbs(ls.File) { logFilePath = ls.File } _, err := os.OpenFile(logFilePath, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644) if err != nil { log.Fatalf("cannot create a log file: %s", err) </s> add logFilePath := ls.File if !filepath.IsAbs(logFilePath) { logFilePath = filepath.Join(Context.workDir, logFilePath) </s> remove func (s *Server) Start() (err error) { </s> add func (s *server) Start() (err error) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
<mask> "path/filepath" <mask> "runtime" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> ) <mask> <mask> const ( </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove "runtime" </s> add </s> remove LeasesDynamic GetLeasesFlags = 0b0001 LeasesStatic GetLeasesFlags = 0b0010 </s> add LeasesDynamic GetLeasesFlags = 0b01 LeasesStatic GetLeasesFlags = 0b10 </s> remove var webHandlersRegistered = false </s> add // Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond )
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
"github.com/AdguardTeam/golibs/timeutil"
<mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> ) <mask> <mask> const ( <mask> // leaseExpireStatic is used to define the Expiry field for static <mask> // leases. <mask> // </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove var webHandlersRegistered = false </s> add // Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond ) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" </s> add </s> remove // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. type ServerConfig struct { // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister aghhttp.RegisterFunc `yaml:"-"` Enabled bool `yaml:"enabled"` InterfaceName string `yaml:"interface_name"` // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` Conf4 V4ServerConf `yaml:"dhcpv4"` Conf6 V6ServerConf `yaml:"dhcpv6"` WorkDir string `yaml:"-"` DBFilePath string `yaml:"-"` } </s> add </s> remove // Server - the current state of the DHCP server type Server struct { srv4 DHCPServer srv6 DHCPServer // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig // Called when the leases DB is modified onLeaseChanged []OnLeaseChangedT } </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
// DefaultDHCPLeaseTTL is the default time-to-live for leases. DefaultDHCPLeaseTTL = uint32(timeutil.Day / time.Second) // DefaultDHCPTimeoutICMP is the default timeout for waiting ICMP responses. DefaultDHCPTimeoutICMP = 1000
<mask> // TODO(e.burkov): Remove it when static leases determining mechanism <mask> // will be improved. <mask> leaseExpireStatic = 1 <mask> ) <mask> <mask> // Currently used defaults for ifaceDNSAddrs. <mask> const ( <mask> defaultMaxAttempts int = 10 <mask> defaultBackoff time.Duration = 500 * time.Millisecond </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove var webHandlersRegistered = false </s> add // Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond ) </s> remove LeasesDynamic GetLeasesFlags = 0b0001 LeasesStatic GetLeasesFlags = 0b0010 </s> add LeasesDynamic GetLeasesFlags = 0b01 LeasesStatic GetLeasesFlags = 0b10 </s> remove // Server - the current state of the DHCP server type Server struct { srv4 DHCPServer srv6 DHCPServer // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig // Called when the leases DB is modified onLeaseChanged []OnLeaseChangedT } </s> add </s> remove // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. type ServerConfig struct { // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister aghhttp.RegisterFunc `yaml:"-"` Enabled bool `yaml:"enabled"` InterfaceName string `yaml:"interface_name"` // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` Conf4 V4ServerConf `yaml:"dhcpv4"` Conf6 V6ServerConf `yaml:"dhcpv6"` WorkDir string `yaml:"-"` DBFilePath string `yaml:"-"` } </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
// Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond )
<mask> // will be improved. <mask> leaseExpireStatic = 1 <mask> ) <mask> <mask> var webHandlersRegistered = false <mask> <mask> // Lease contains the necessary information about a DHCP lease <mask> type Lease struct { <mask> // Expiry is the expiration time of the lease. The unix timestamp value <mask> // of 1 means that this is a static lease. </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. type ServerConfig struct { // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister aghhttp.RegisterFunc `yaml:"-"` Enabled bool `yaml:"enabled"` InterfaceName string `yaml:"interface_name"` // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` Conf4 V4ServerConf `yaml:"dhcpv4"` Conf6 V6ServerConf `yaml:"dhcpv6"` WorkDir string `yaml:"-"` DBFilePath string `yaml:"-"` } </s> add </s> remove // Server - the current state of the DHCP server type Server struct { srv4 DHCPServer srv6 DHCPServer // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig // Called when the leases DB is modified onLeaseChanged []OnLeaseChangedT } </s> add </s> remove dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.ServerInterface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> add dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.Interface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
<mask> <mask> return nil <mask> } <mask> <mask> // ServerConfig is the configuration for the DHCP server. The order of YAML <mask> // fields is important, since the YAML configuration file follows it. <mask> type ServerConfig struct { <mask> // Called when the configuration is changed by HTTP request <mask> ConfigModified func() `yaml:"-"` <mask> <mask> // Register an HTTP handler <mask> HTTPRegister aghhttp.RegisterFunc `yaml:"-"` <mask> <mask> Enabled bool `yaml:"enabled"` <mask> InterfaceName string `yaml:"interface_name"` <mask> <mask> // LocalDomainName is the domain name used for DHCP hosts. For example, <mask> // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" <mask> // when LocalDomainName is "lan". <mask> LocalDomainName string `yaml:"local_domain_name"` <mask> <mask> Conf4 V4ServerConf `yaml:"dhcpv4"` <mask> Conf6 V6ServerConf `yaml:"dhcpv6"` <mask> <mask> WorkDir string `yaml:"-"` <mask> DBFilePath string `yaml:"-"` <mask> } <mask> <mask> // OnLeaseChangedT is a callback for lease changes. <mask> type OnLeaseChangedT func(flags int) <mask> <mask> // flags for onLeaseChanged() <mask> const ( </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove // Server - the current state of the DHCP server type Server struct { srv4 DHCPServer srv6 DHCPServer // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig // Called when the leases DB is modified onLeaseChanged []OnLeaseChangedT } </s> add </s> remove var webHandlersRegistered = false </s> add // Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond ) </s> remove dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.ServerInterface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> add dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.Interface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> remove // ServerInterface is an interface for servers. type ServerInterface interface { </s> add // Interface is the DHCP server that deals with both IP address families. type Interface interface { Start() (err error) Stop() (err error)
[ "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", "re...
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
<mask> <mask> LeaseChangedDBStore <mask> ) <mask> <mask> // Server - the current state of the DHCP server <mask> type Server struct { <mask> srv4 DHCPServer <mask> srv6 DHCPServer <mask> <mask> // TODO(a.garipov): Either create a separate type for the internal config or <mask> // just put the config values into Server. <mask> conf *ServerConfig <mask> <mask> // Called when the leases DB is modified <mask> onLeaseChanged []OnLeaseChangedT <mask> } <mask> <mask> // GetLeasesFlags are the flags for GetLeases. <mask> type GetLeasesFlags uint8 <mask> <mask> // GetLeasesFlags values <mask> const ( </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove LeasesDynamic GetLeasesFlags = 0b0001 LeasesStatic GetLeasesFlags = 0b0010 </s> add LeasesDynamic GetLeasesFlags = 0b01 LeasesStatic GetLeasesFlags = 0b10 </s> remove // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. type ServerConfig struct { // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister aghhttp.RegisterFunc `yaml:"-"` Enabled bool `yaml:"enabled"` InterfaceName string `yaml:"interface_name"` // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` Conf4 V4ServerConf `yaml:"dhcpv4"` Conf6 V6ServerConf `yaml:"dhcpv6"` WorkDir string `yaml:"-"` DBFilePath string `yaml:"-"` } </s> add </s> remove var webHandlersRegistered = false </s> add // Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond ) </s> remove dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.ServerInterface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> add dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.Interface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> remove // ServerInterface is an interface for servers. type ServerInterface interface { </s> add // Interface is the DHCP server that deals with both IP address families. type Interface interface { Start() (err error) Stop() (err error)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
LeasesDynamic GetLeasesFlags = 0b01 LeasesStatic GetLeasesFlags = 0b10
<mask> type GetLeasesFlags uint8 <mask> <mask> // GetLeasesFlags values <mask> const ( <mask> LeasesDynamic GetLeasesFlags = 0b0001 <mask> LeasesStatic GetLeasesFlags = 0b0010 <mask> <mask> LeasesAll = LeasesDynamic | LeasesStatic <mask> ) <mask> <mask> // ServerInterface is an interface for servers. </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove // ServerInterface is an interface for servers. type ServerInterface interface { </s> add // Interface is the DHCP server that deals with both IP address families. type Interface interface { Start() (err error) Stop() (err error) </s> remove // Server - the current state of the DHCP server type Server struct { srv4 DHCPServer srv6 DHCPServer // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig // Called when the leases DB is modified onLeaseChanged []OnLeaseChangedT } </s> add </s> remove var webHandlersRegistered = false </s> add // Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond )
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
// Interface is the DHCP server that deals with both IP address families. type Interface interface { Start() (err error) Stop() (err error)
<mask> <mask> LeasesAll = LeasesDynamic | LeasesStatic <mask> ) <mask> <mask> // ServerInterface is an interface for servers. <mask> type ServerInterface interface { <mask> Enabled() (ok bool) <mask> Leases(flags GetLeasesFlags) (leases []*Lease) <mask> SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) <mask> } <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove LeasesDynamic GetLeasesFlags = 0b0001 LeasesStatic GetLeasesFlags = 0b0010 </s> add LeasesDynamic GetLeasesFlags = 0b01 LeasesStatic GetLeasesFlags = 0b10 </s> remove func (s *Server) Enabled() (ok bool) { </s> add func (s *server) Enabled() (ok bool) { </s> remove func (s *Server) Leases(flags GetLeasesFlags) (leases []*Lease) { </s> add func (s *server) Leases(flags GetLeasesFlags) (leases []*Lease) { </s> remove // Create - create object func Create(conf *ServerConfig) (s *Server, err error) { s = &Server{ </s> add // type check var _ Interface = (*server)(nil) // Create initializes and returns the DHCP server handling both address // families. It also registers the corresponding HTTP API endpoints. // // TODO(e.burkov): Don't register handlers, see TODO on [aghhttp.RegisterFunc]. func Create(conf *ServerConfig) (s *server, err error) { s = &server{ </s> remove type testDHCP struct{} func (d *testDHCP) Enabled() (ok bool) { return true } func (d *testDHCP) Leases(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { return []*dhcpd.Lease{{ IP: net.IP{192, 168, 12, 34}, HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, Hostname: "myhost", }} </s> add var testDHCP = &dhcpd.MockInterface{ OnStart: func() (err error) { panic("not implemented") }, OnStop: func() (err error) { panic("not implemented") }, OnEnabled: func() (ok bool) { return true }, OnLeases: func(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { return []*dhcpd.Lease{{ IP: net.IP{192, 168, 12, 34}, HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, Hostname: "myhost", }} }, OnSetOnLeaseChanged: func(olct dhcpd.OnLeaseChangedT) {}, OnFindMACbyIP: func(ip net.IP) (mac net.HardwareAddr) { panic("not implemented") }, OnWriteDiskConfig: func(c *dhcpd.ServerConfig) { panic("not implemented") },
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
// type check var _ Interface = (*server)(nil) // Create initializes and returns the DHCP server handling both address // families. It also registers the corresponding HTTP API endpoints. // // TODO(e.burkov): Don't register handlers, see TODO on [aghhttp.RegisterFunc]. func Create(conf *ServerConfig) (s *server, err error) { s = &server{
<mask> Leases(flags GetLeasesFlags) (leases []*Lease) <mask> SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) <mask> } <mask> <mask> // Create - create object <mask> func Create(conf *ServerConfig) (s *Server, err error) { <mask> s = &Server{ <mask> conf: &ServerConfig{ <mask> ConfigModified: conf.ConfigModified, <mask> <mask> HTTPRegister: conf.HTTPRegister, <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) Leases(flags GetLeasesFlags) (leases []*Lease) { </s> add func (s *server) Leases(flags GetLeasesFlags) (leases []*Lease) { </s> remove // ServerInterface is an interface for servers. type ServerInterface interface { </s> add // Interface is the DHCP server that deals with both IP address families. type Interface interface { Start() (err error) Stop() (err error) </s> remove func (s *Server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) { </s> add func (s *server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) { </s> remove func (s *Server) WriteDiskConfig(c *ServerConfig) { </s> add func (s *server) WriteDiskConfig(c *ServerConfig) { </s> remove func (s *winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (s *winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (s *winServer) getLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) FindMACbyIP(ip net.IP) (mac net.HardwareAddr) { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() (err error) { return nil } func (s *winServer) Stop() (err error) { return nil } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add // type check var _ DHCPServer = winServer{} func (winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (winServer) getLeasesRef() []*Lease { return nil } func (winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (winServer) FindMACbyIP(_ net.IP) (mac net.HardwareAddr) { return nil } func (winServer) WriteDiskConfig4(_ *V4ServerConf) {} func (winServer) WriteDiskConfig6(_ *V6ServerConf) {} func (winServer) Start() (err error) { return nil } func (winServer) Stop() (err error) { return nil } func v4Create(_ *V4ServerConf) (s DHCPServer, err error) { return winServer{}, nil } func v6Create(_ V6ServerConf) (s DHCPServer, err error) { return winServer{}, nil }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
s.registerHandlers()
<mask> DBFilePath: filepath.Join(conf.WorkDir, dbFilename), <mask> }, <mask> } <mask> <mask> if !webHandlersRegistered && s.conf.HTTPRegister != nil { <mask> if runtime.GOOS == "windows" { <mask> // Our DHCP server doesn't work on Windows yet, so <mask> // signal that to the front with an HTTP 501. <mask> // <mask> // TODO(a.garipov): This needs refactoring. We <mask> // shouldn't even try and initialize a DHCP server on <mask> // Windows, but there are currently too many <mask> // interconnected parts--such as HTTP handlers and <mask> // frontend--to make that work properly. <mask> s.registerNotImplementedHandlers() <mask> } else { <mask> s.registerHandlers() <mask> } <mask> <mask> webHandlersRegistered = true <mask> } <mask> <mask> v4conf := conf.Conf4 <mask> v4conf.Enabled = s.conf.Enabled <mask> if len(v4conf.RangeStart) == 0 { <mask> v4conf.Enabled = false </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove v4conf.Enabled = s.conf.Enabled if len(v4conf.RangeStart) == 0 { v4conf.Enabled = false } </s> add </s> remove var err error </s> add </s> remove func (s *Server) dbStore() (err error) { </s> add func (s *server) dbStore() (err error) { </s> remove // Create - create object func Create(conf *ServerConfig) (s *Server, err error) { s = &Server{ </s> add // type check var _ Interface = (*server)(nil) // Create initializes and returns the DHCP server handling both address // families. It also registers the corresponding HTTP API endpoints. // // TODO(e.burkov): Don't register handlers, see TODO on [aghhttp.RegisterFunc]. func Create(conf *ServerConfig) (s *server, err error) { s = &server{ </s> remove func (s *Server) Start() (err error) { </s> add func (s *server) Start() (err error) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
<mask> webHandlersRegistered = true <mask> } <mask> <mask> v4conf := conf.Conf4 <mask> v4conf.Enabled = s.conf.Enabled <mask> if len(v4conf.RangeStart) == 0 { <mask> v4conf.Enabled = false <mask> } <mask> <mask> v4conf.InterfaceName = s.conf.InterfaceName <mask> v4conf.notify = s.onNotify <mask> s.srv4, err = v4Create(v4conf) <mask> if err != nil { <mask> return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) </s> add if v4conf.Enabled { return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) } log.Error("creating dhcpv4 srv: %s", err) </s> remove s.srv4, err = v4Create(v4conf) </s> add v4conf.Enabled = s.conf.Enabled && len(v4conf.RangeStart) != 0 s.srv4, err = v4Create(&v4conf) </s> remove if !webHandlersRegistered && s.conf.HTTPRegister != nil { if runtime.GOOS == "windows" { // Our DHCP server doesn't work on Windows yet, so // signal that to the front with an HTTP 501. // // TODO(a.garipov): This needs refactoring. We // shouldn't even try and initialize a DHCP server on // Windows, but there are currently too many // interconnected parts--such as HTTP handlers and // frontend--to make that work properly. s.registerNotImplementedHandlers() } else { s.registerHandlers() } webHandlersRegistered = true } </s> add s.registerHandlers() </s> remove if len(explicit) == 0 { explicit = nil </s> add if len(s.explicitOpts) == 0 { s.explicitOpts = nil </s> remove return implicit, explicit </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
v4conf.Enabled = s.conf.Enabled && len(v4conf.RangeStart) != 0 s.srv4, err = v4Create(&v4conf)
<mask> } <mask> <mask> v4conf.InterfaceName = s.conf.InterfaceName <mask> v4conf.notify = s.onNotify <mask> s.srv4, err = v4Create(v4conf) <mask> if err != nil { <mask> return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) <mask> } <mask> <mask> v6conf := conf.Conf6 </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) </s> add if v4conf.Enabled { return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) } log.Error("creating dhcpv4 srv: %s", err) </s> remove v4conf.Enabled = s.conf.Enabled if len(v4conf.RangeStart) == 0 { v4conf.Enabled = false } </s> add </s> remove logFilePath := filepath.Join(Context.workDir, ls.File) if filepath.IsAbs(ls.File) { logFilePath = ls.File } _, err := os.OpenFile(logFilePath, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644) if err != nil { log.Fatalf("cannot create a log file: %s", err) </s> add logFilePath := ls.File if !filepath.IsAbs(logFilePath) { logFilePath = filepath.Join(Context.workDir, logFilePath) </s> remove func (s *Server) Stop() (err error) { </s> add func (s *server) Stop() (err error) { </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
if v4conf.Enabled { return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) } log.Error("creating dhcpv4 srv: %s", err)
<mask> v4conf.InterfaceName = s.conf.InterfaceName <mask> v4conf.notify = s.onNotify <mask> s.srv4, err = v4Create(v4conf) <mask> if err != nil { <mask> return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) <mask> } <mask> <mask> v6conf := conf.Conf6 <mask> v6conf.Enabled = s.conf.Enabled <mask> if len(v6conf.RangeStart) == 0 { </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove s.srv4, err = v4Create(v4conf) </s> add v4conf.Enabled = s.conf.Enabled && len(v4conf.RangeStart) != 0 s.srv4, err = v4Create(&v4conf) </s> remove v4conf.Enabled = s.conf.Enabled if len(v4conf.RangeStart) == 0 { v4conf.Enabled = false } </s> add </s> remove if len(explicit) == 0 { explicit = nil </s> add if len(s.explicitOpts) == 0 { s.explicitOpts = nil </s> remove return implicit, explicit </s> add </s> remove logFilePath := filepath.Join(Context.workDir, ls.File) if filepath.IsAbs(ls.File) { logFilePath = ls.File } _, err := os.OpenFile(logFilePath, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644) if err != nil { log.Fatalf("cannot create a log file: %s", err) </s> add logFilePath := ls.File if !filepath.IsAbs(logFilePath) { logFilePath = filepath.Join(Context.workDir, logFilePath)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
func (s *server) Enabled() (ok bool) {
<mask> return s, nil <mask> } <mask> <mask> // Enabled returns true when the server is enabled. <mask> func (s *Server) Enabled() (ok bool) { <mask> return s.conf.Enabled <mask> } <mask> <mask> // resetLeases resets all leases in the lease database. <mask> func (s *Server) resetLeases() (err error) { </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) { </s> remove func (s *Server) dbStore() (err error) { </s> add func (s *server) dbStore() (err error) { </s> remove func (s *Server) Leases(flags GetLeasesFlags) (leases []*Lease) { </s> add func (s *server) Leases(flags GetLeasesFlags) (leases []*Lease) { </s> remove func (s *Server) Stop() (err error) { </s> add func (s *server) Stop() (err error) { </s> remove // ServerInterface is an interface for servers. type ServerInterface interface { </s> add // Interface is the DHCP server that deals with both IP address families. type Interface interface { Start() (err error) Stop() (err error)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
func (s *server) resetLeases() (err error) {
<mask> return s.conf.Enabled <mask> } <mask> <mask> // resetLeases resets all leases in the lease database. <mask> func (s *Server) resetLeases() (err error) { <mask> err = s.srv4.ResetLeases(nil) <mask> if err != nil { <mask> return err <mask> } <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) Enabled() (ok bool) { </s> add func (s *server) Enabled() (ok bool) { </s> remove func (s *Server) Stop() (err error) { </s> add func (s *server) Stop() (err error) { </s> remove func (s *Server) Start() (err error) { </s> add func (s *server) Start() (err error) { </s> remove func (s *Server) dbStore() (err error) { </s> add func (s *server) dbStore() (err error) { </s> remove func (s *Server) FindMACbyIP(ip net.IP) net.HardwareAddr { </s> add func (s *server) FindMACbyIP(ip net.IP) net.HardwareAddr {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
func (s *server) onNotify(flags uint32) {
<mask> return s.dbStore() <mask> } <mask> <mask> // server calls this function after DB is updated <mask> func (s *Server) onNotify(flags uint32) { <mask> if flags == LeaseChangedDBStore { <mask> err := s.dbStore() <mask> if err != nil { <mask> log.Error("updating db: %s", err) <mask> } </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove logFilePath := filepath.Join(Context.workDir, ls.File) if filepath.IsAbs(ls.File) { logFilePath = ls.File } _, err := os.OpenFile(logFilePath, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644) if err != nil { log.Fatalf("cannot create a log file: %s", err) </s> add logFilePath := ls.File if !filepath.IsAbs(logFilePath) { logFilePath = filepath.Join(Context.workDir, logFilePath) </s> remove return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) </s> add if v4conf.Enabled { return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) } log.Error("creating dhcpv4 srv: %s", err) </s> remove func (s *Server) Stop() (err error) { </s> add func (s *server) Stop() (err error) { </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) { </s> remove func (s *Server) Start() (err error) { </s> add func (s *server) Start() (err error) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
func (s *server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) {
<mask> s.notify(int(flags)) <mask> } <mask> <mask> // SetOnLeaseChanged - set callback <mask> func (s *Server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) { <mask> s.onLeaseChanged = append(s.onLeaseChanged, onLeaseChanged) <mask> } <mask> <mask> func (s *Server) notify(flags int) { <mask> if len(s.onLeaseChanged) == 0 { </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) notify(flags int) { if len(s.onLeaseChanged) == 0 { return } </s> add func (s *server) notify(flags int) { </s> remove func (s *Server) WriteDiskConfig(c *ServerConfig) { </s> add func (s *server) WriteDiskConfig(c *ServerConfig) { </s> remove func (s *Server) AddStaticLease(l *Lease) error { </s> add func (s *server) AddStaticLease(l *Lease) error { </s> remove func (s *Server) onNotify(flags uint32) { </s> add func (s *server) onNotify(flags uint32) { </s> remove func (s *Server) FindMACbyIP(ip net.IP) net.HardwareAddr { </s> add func (s *server) FindMACbyIP(ip net.IP) net.HardwareAddr {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
func (s *server) notify(flags int) {
<mask> func (s *Server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) { <mask> s.onLeaseChanged = append(s.onLeaseChanged, onLeaseChanged) <mask> } <mask> <mask> func (s *Server) notify(flags int) { <mask> if len(s.onLeaseChanged) == 0 { <mask> return <mask> } <mask> <mask> for _, f := range s.onLeaseChanged { <mask> f(flags) <mask> } <mask> } <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) { </s> add func (s *server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) { </s> remove func (s *Server) onNotify(flags uint32) { </s> add func (s *server) onNotify(flags uint32) { </s> remove func (s *Server) Stop() (err error) { </s> add func (s *server) Stop() (err error) { </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) { </s> remove func (s *Server) Start() (err error) { </s> add func (s *server) Start() (err error) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
func (s *server) WriteDiskConfig(c *ServerConfig) {
<mask> } <mask> } <mask> <mask> // WriteDiskConfig - write configuration <mask> func (s *Server) WriteDiskConfig(c *ServerConfig) { <mask> c.Enabled = s.conf.Enabled <mask> c.InterfaceName = s.conf.InterfaceName <mask> c.LocalDomainName = s.conf.LocalDomainName <mask> s.srv4.WriteDiskConfig4(&c.Conf4) <mask> s.srv6.WriteDiskConfig6(&c.Conf6) </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) { </s> add func (s *server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) { </s> remove func (s *Server) Start() (err error) { </s> add func (s *server) Start() (err error) { </s> remove // Create - create object func Create(conf *ServerConfig) (s *Server, err error) { s = &Server{ </s> add // type check var _ Interface = (*server)(nil) // Create initializes and returns the DHCP server handling both address // families. It also registers the corresponding HTTP API endpoints. // // TODO(e.burkov): Don't register handlers, see TODO on [aghhttp.RegisterFunc]. func Create(conf *ServerConfig) (s *server, err error) { s = &server{ </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) { </s> remove v4conf.Enabled = s.conf.Enabled if len(v4conf.RangeStart) == 0 { v4conf.Enabled = false } </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
func (s *server) Start() (err error) {
<mask> s.srv6.WriteDiskConfig6(&c.Conf6) <mask> } <mask> <mask> // Start will listen on port 67 and serve DHCP requests. <mask> func (s *Server) Start() (err error) { <mask> err = s.srv4.Start() <mask> if err != nil { <mask> return err <mask> } <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) Stop() (err error) { </s> add func (s *server) Stop() (err error) { </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) { </s> remove func (s *winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (s *winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (s *winServer) getLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) FindMACbyIP(ip net.IP) (mac net.HardwareAddr) { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() (err error) { return nil } func (s *winServer) Stop() (err error) { return nil } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add // type check var _ DHCPServer = winServer{} func (winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (winServer) getLeasesRef() []*Lease { return nil } func (winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (winServer) FindMACbyIP(_ net.IP) (mac net.HardwareAddr) { return nil } func (winServer) WriteDiskConfig4(_ *V4ServerConf) {} func (winServer) WriteDiskConfig6(_ *V6ServerConf) {} func (winServer) Start() (err error) { return nil } func (winServer) Stop() (err error) { return nil } func v4Create(_ *V4ServerConf) (s DHCPServer, err error) { return winServer{}, nil } func v6Create(_ V6ServerConf) (s DHCPServer, err error) { return winServer{}, nil } </s> remove func (s *Server) onNotify(flags uint32) { </s> add func (s *server) onNotify(flags uint32) { </s> remove func (s *Server) WriteDiskConfig(c *ServerConfig) { </s> add func (s *server) WriteDiskConfig(c *ServerConfig) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
func (s *server) Stop() (err error) {
<mask> return nil <mask> } <mask> <mask> // Stop closes the listening UDP socket <mask> func (s *Server) Stop() (err error) { <mask> err = s.srv4.Stop() <mask> if err != nil { <mask> return err <mask> } <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) { </s> remove func (s *Server) Start() (err error) { </s> add func (s *server) Start() (err error) { </s> remove func (s *winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (s *winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (s *winServer) getLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) FindMACbyIP(ip net.IP) (mac net.HardwareAddr) { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() (err error) { return nil } func (s *winServer) Stop() (err error) { return nil } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add // type check var _ DHCPServer = winServer{} func (winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (winServer) getLeasesRef() []*Lease { return nil } func (winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (winServer) FindMACbyIP(_ net.IP) (mac net.HardwareAddr) { return nil } func (winServer) WriteDiskConfig4(_ *V4ServerConf) {} func (winServer) WriteDiskConfig6(_ *V6ServerConf) {} func (winServer) Start() (err error) { return nil } func (winServer) Stop() (err error) { return nil } func v4Create(_ *V4ServerConf) (s DHCPServer, err error) { return winServer{}, nil } func v6Create(_ V6ServerConf) (s DHCPServer, err error) { return winServer{}, nil } </s> remove func (s *Server) onNotify(flags uint32) { </s> add func (s *server) onNotify(flags uint32) { </s> remove func (s *Server) Enabled() (ok bool) { </s> add func (s *server) Enabled() (ok bool) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
func (s *server) Leases(flags GetLeasesFlags) (leases []*Lease) {
<mask> } <mask> <mask> // Leases returns the list of active IPv4 and IPv6 DHCP leases. It's safe for <mask> // concurrent use. <mask> func (s *Server) Leases(flags GetLeasesFlags) (leases []*Lease) { <mask> return append(s.srv4.GetLeases(flags), s.srv6.GetLeases(flags)...) <mask> } <mask> <mask> // FindMACbyIP - find a MAC address by IP address in the currently active DHCP leases <mask> func (s *Server) FindMACbyIP(ip net.IP) net.HardwareAddr { </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) FindMACbyIP(ip net.IP) net.HardwareAddr { </s> add func (s *server) FindMACbyIP(ip net.IP) net.HardwareAddr { </s> remove // Create - create object func Create(conf *ServerConfig) (s *Server, err error) { s = &Server{ </s> add // type check var _ Interface = (*server)(nil) // Create initializes and returns the DHCP server handling both address // families. It also registers the corresponding HTTP API endpoints. // // TODO(e.burkov): Don't register handlers, see TODO on [aghhttp.RegisterFunc]. func Create(conf *ServerConfig) (s *server, err error) { s = &server{ </s> remove func (s *Server) Enabled() (ok bool) { </s> add func (s *server) Enabled() (ok bool) { </s> remove // ServerInterface is an interface for servers. type ServerInterface interface { </s> add // Interface is the DHCP server that deals with both IP address families. type Interface interface { Start() (err error) Stop() (err error) </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
func (s *server) FindMACbyIP(ip net.IP) net.HardwareAddr {
<mask> return append(s.srv4.GetLeases(flags), s.srv6.GetLeases(flags)...) <mask> } <mask> <mask> // FindMACbyIP - find a MAC address by IP address in the currently active DHCP leases <mask> func (s *Server) FindMACbyIP(ip net.IP) net.HardwareAddr { <mask> if ip.To4() != nil { <mask> return s.srv4.FindMACbyIP(ip) <mask> } <mask> return s.srv6.FindMACbyIP(ip) <mask> } </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) Leases(flags GetLeasesFlags) (leases []*Lease) { </s> add func (s *server) Leases(flags GetLeasesFlags) (leases []*Lease) { </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) { </s> remove func (s *Server) AddStaticLease(l *Lease) error { </s> add func (s *server) AddStaticLease(l *Lease) error { </s> remove func (s *Server) Enabled() (ok bool) { </s> add func (s *server) Enabled() (ok bool) { </s> remove func (s *Server) Stop() (err error) { </s> add func (s *server) Stop() (err error) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
func (s *server) AddStaticLease(l *Lease) error {
<mask> return s.srv6.FindMACbyIP(ip) <mask> } <mask> <mask> // AddStaticLease - add static v4 lease <mask> func (s *Server) AddStaticLease(l *Lease) error { <mask> return s.srv4.AddStaticLease(l) <mask> } </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) FindMACbyIP(ip net.IP) net.HardwareAddr { </s> add func (s *server) FindMACbyIP(ip net.IP) net.HardwareAddr { </s> remove func (s *winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (s *winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (s *winServer) getLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) FindMACbyIP(ip net.IP) (mac net.HardwareAddr) { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() (err error) { return nil } func (s *winServer) Stop() (err error) { return nil } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add // type check var _ DHCPServer = winServer{} func (winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (winServer) getLeasesRef() []*Lease { return nil } func (winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (winServer) FindMACbyIP(_ net.IP) (mac net.HardwareAddr) { return nil } func (winServer) WriteDiskConfig4(_ *V4ServerConf) {} func (winServer) WriteDiskConfig6(_ *V6ServerConf) {} func (winServer) Start() (err error) { return nil } func (winServer) Stop() (err error) { return nil } func v4Create(_ *V4ServerConf) (s DHCPServer, err error) { return winServer{}, nil } func v6Create(_ V6ServerConf) (s DHCPServer, err error) { return winServer{}, nil } </s> remove func (s *Server) Enabled() (ok bool) { </s> add func (s *server) Enabled() (ok bool) { </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) { </s> remove func (s *Server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) { </s> add func (s *server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/dhcpd.go
func (s *v4Server) prepareOptions() {
<mask> } <mask> <mask> // prepareOptions builds the set of DHCP options according to host requirements <mask> // document and values from conf. <mask> func prepareOptions(conf V4ServerConf) (implicit, explicit dhcpv4.Options) { <mask> // Set default values of host configuration parameters listed in Appendix A <mask> // of RFC-2131. <mask> implicit = dhcpv4.OptionsFromList( <mask> // IP-Layer Per Host <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove implicit = dhcpv4.OptionsFromList( </s> add s.implicitOpts = dhcpv4.OptionsFromList( </s> remove dhcpv4.OptSubnetMask(conf.subnet.Mask), </s> add dhcpv4.OptSubnetMask(s.conf.subnet.Mask), </s> remove dhcpv4.OptRouter(conf.subnet.IP), </s> add dhcpv4.OptRouter(s.conf.subnet.IP), </s> remove // Server - the current state of the DHCP server type Server struct { srv4 DHCPServer srv6 DHCPServer // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig // Called when the leases DB is modified onLeaseChanged []OnLeaseChangedT } </s> add </s> remove func (s *Server) Leases(flags GetLeasesFlags) (leases []*Lease) { </s> add func (s *server) Leases(flags GetLeasesFlags) (leases []*Lease) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix.go
s.implicitOpts = dhcpv4.OptionsFromList(
<mask> // document and values from conf. <mask> func prepareOptions(conf V4ServerConf) (implicit, explicit dhcpv4.Options) { <mask> // Set default values of host configuration parameters listed in Appendix A <mask> // of RFC-2131. <mask> implicit = dhcpv4.OptionsFromList( <mask> // IP-Layer Per Host <mask> <mask> // An Internet host that includes embedded gateway code MUST have a <mask> // configuration switch to disable the gateway function, and this switch <mask> // MUST default to the non-gateway mode. </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func prepareOptions(conf V4ServerConf) (implicit, explicit dhcpv4.Options) { </s> add func (s *v4Server) prepareOptions() { </s> remove dhcpv4.OptSubnetMask(conf.subnet.Mask), </s> add dhcpv4.OptSubnetMask(s.conf.subnet.Mask), </s> remove dhcpv4.OptRouter(conf.subnet.IP), </s> add dhcpv4.OptRouter(s.conf.subnet.IP), </s> remove // options to allow broadcasting, it also binds the connection to a // specific interface. On FreeBSD and OpenBSD net.UDPConn.WriteTo // causes errors while writing to the addresses that belong to another // interface. So, use the broadcast address specific for the interface // bound. </s> add // options to allow broadcasting, it also binds the connection to a specific // interface. On FreeBSD and OpenBSD net.UDPConn.WriteTo causes errors // while writing to the addresses that belong to another interface. So, use // the broadcast address specific for the interface bound. </s> remove var webHandlersRegistered = false </s> add // Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond )
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix.go
dhcpv4.OptRouter(s.conf.subnet.IP),
<mask> // Values From Configuration <mask> <mask> // Set the Router Option to working subnet's IP since it's initialized <mask> // with the address of the gateway. <mask> dhcpv4.OptRouter(conf.subnet.IP), <mask> <mask> dhcpv4.OptSubnetMask(conf.subnet.Mask), <mask> ) <mask> <mask> // Set values for explicitly configured options. </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove dhcpv4.OptSubnetMask(conf.subnet.Mask), </s> add dhcpv4.OptSubnetMask(s.conf.subnet.Mask), </s> remove explicit = dhcpv4.Options{} for i, o := range conf.Options { </s> add s.explicitOpts = dhcpv4.Options{} for i, o := range s.conf.Options { </s> remove func prepareOptions(conf V4ServerConf) (implicit, explicit dhcpv4.Options) { </s> add func (s *v4Server) prepareOptions() { </s> remove implicit = dhcpv4.OptionsFromList( </s> add s.implicitOpts = dhcpv4.OptionsFromList( </s> remove // options to allow broadcasting, it also binds the connection to a // specific interface. On FreeBSD and OpenBSD net.UDPConn.WriteTo // causes errors while writing to the addresses that belong to another // interface. So, use the broadcast address specific for the interface // bound. </s> add // options to allow broadcasting, it also binds the connection to a specific // interface. On FreeBSD and OpenBSD net.UDPConn.WriteTo causes errors // while writing to the addresses that belong to another interface. So, use // the broadcast address specific for the interface bound.
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix.go
dhcpv4.OptSubnetMask(s.conf.subnet.Mask),
<mask> // Set the Router Option to working subnet's IP since it's initialized <mask> // with the address of the gateway. <mask> dhcpv4.OptRouter(conf.subnet.IP), <mask> <mask> dhcpv4.OptSubnetMask(conf.subnet.Mask), <mask> ) <mask> <mask> // Set values for explicitly configured options. <mask> explicit = dhcpv4.Options{} <mask> for i, o := range conf.Options { </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove dhcpv4.OptRouter(conf.subnet.IP), </s> add dhcpv4.OptRouter(s.conf.subnet.IP), </s> remove explicit = dhcpv4.Options{} for i, o := range conf.Options { </s> add s.explicitOpts = dhcpv4.Options{} for i, o := range s.conf.Options { </s> remove func prepareOptions(conf V4ServerConf) (implicit, explicit dhcpv4.Options) { </s> add func (s *v4Server) prepareOptions() { </s> remove implicit = dhcpv4.OptionsFromList( </s> add s.implicitOpts = dhcpv4.OptionsFromList( </s> remove // options to allow broadcasting, it also binds the connection to a // specific interface. On FreeBSD and OpenBSD net.UDPConn.WriteTo // causes errors while writing to the addresses that belong to another // interface. So, use the broadcast address specific for the interface // bound. </s> add // options to allow broadcasting, it also binds the connection to a specific // interface. On FreeBSD and OpenBSD net.UDPConn.WriteTo causes errors // while writing to the addresses that belong to another interface. So, use // the broadcast address specific for the interface bound.
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix.go
s.explicitOpts = dhcpv4.Options{} for i, o := range s.conf.Options {
<mask> dhcpv4.OptSubnetMask(conf.subnet.Mask), <mask> ) <mask> <mask> // Set values for explicitly configured options. <mask> explicit = dhcpv4.Options{} <mask> for i, o := range conf.Options { <mask> code, val, err := parseDHCPOption(o) <mask> if err != nil { <mask> log.Error("dhcpv4: bad option string at index %d: %s", i, err) <mask> <mask> continue </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove dhcpv4.OptSubnetMask(conf.subnet.Mask), </s> add dhcpv4.OptSubnetMask(s.conf.subnet.Mask), </s> remove dhcpv4.OptRouter(conf.subnet.IP), </s> add dhcpv4.OptRouter(s.conf.subnet.IP), </s> remove logFilePath := filepath.Join(Context.workDir, ls.File) if filepath.IsAbs(ls.File) { logFilePath = ls.File } _, err := os.OpenFile(logFilePath, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644) if err != nil { log.Fatalf("cannot create a log file: %s", err) </s> add logFilePath := ls.File if !filepath.IsAbs(logFilePath) { logFilePath = filepath.Join(Context.workDir, logFilePath) </s> remove return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) </s> add if v4conf.Enabled { return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) } log.Error("creating dhcpv4 srv: %s", err) </s> remove func (s *Server) onNotify(flags uint32) { </s> add func (s *server) onNotify(flags uint32) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix.go
s.explicitOpts.Update(dhcpv4.Option{Code: code, Value: val})
<mask> <mask> continue <mask> } <mask> <mask> explicit.Update(dhcpv4.Option{Code: code, Value: val}) <mask> // Remove those from the implicit options. <mask> delete(implicit, code.Code()) <mask> } <mask> <mask> log.Debug("dhcpv4: implicit options:\n%s", implicit.Summary(nil)) </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove delete(implicit, code.Code()) </s> add delete(s.implicitOpts, code.Code()) </s> remove log.Debug("dhcpv4: implicit options:\n%s", implicit.Summary(nil)) log.Debug("dhcpv4: explicit options:\n%s", explicit.Summary(nil)) </s> add log.Debug("dhcpv4: implicit options:\n%s", s.implicitOpts.Summary(nil)) log.Debug("dhcpv4: explicit options:\n%s", s.explicitOpts.Summary(nil)) </s> remove if len(explicit) == 0 { explicit = nil </s> add if len(s.explicitOpts) == 0 { s.explicitOpts = nil </s> remove func prepareOptions(conf V4ServerConf) (implicit, explicit dhcpv4.Options) { </s> add func (s *v4Server) prepareOptions() { </s> remove explicit = dhcpv4.Options{} for i, o := range conf.Options { </s> add s.explicitOpts = dhcpv4.Options{} for i, o := range s.conf.Options {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix.go
delete(s.implicitOpts, code.Code())
<mask> } <mask> <mask> explicit.Update(dhcpv4.Option{Code: code, Value: val}) <mask> // Remove those from the implicit options. <mask> delete(implicit, code.Code()) <mask> } <mask> <mask> log.Debug("dhcpv4: implicit options:\n%s", implicit.Summary(nil)) <mask> log.Debug("dhcpv4: explicit options:\n%s", explicit.Summary(nil)) <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove explicit.Update(dhcpv4.Option{Code: code, Value: val}) </s> add s.explicitOpts.Update(dhcpv4.Option{Code: code, Value: val}) </s> remove log.Debug("dhcpv4: implicit options:\n%s", implicit.Summary(nil)) log.Debug("dhcpv4: explicit options:\n%s", explicit.Summary(nil)) </s> add log.Debug("dhcpv4: implicit options:\n%s", s.implicitOpts.Summary(nil)) log.Debug("dhcpv4: explicit options:\n%s", s.explicitOpts.Summary(nil)) </s> remove if len(explicit) == 0 { explicit = nil </s> add if len(s.explicitOpts) == 0 { s.explicitOpts = nil </s> remove func prepareOptions(conf V4ServerConf) (implicit, explicit dhcpv4.Options) { </s> add func (s *v4Server) prepareOptions() { </s> remove implicit = dhcpv4.OptionsFromList( </s> add s.implicitOpts = dhcpv4.OptionsFromList(
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix.go
log.Debug("dhcpv4: implicit options:\n%s", s.implicitOpts.Summary(nil)) log.Debug("dhcpv4: explicit options:\n%s", s.explicitOpts.Summary(nil))
<mask> // Remove those from the implicit options. <mask> delete(implicit, code.Code()) <mask> } <mask> <mask> log.Debug("dhcpv4: implicit options:\n%s", implicit.Summary(nil)) <mask> log.Debug("dhcpv4: explicit options:\n%s", explicit.Summary(nil)) <mask> <mask> if len(explicit) == 0 { <mask> explicit = nil <mask> } <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove delete(implicit, code.Code()) </s> add delete(s.implicitOpts, code.Code()) </s> remove if len(explicit) == 0 { explicit = nil </s> add if len(s.explicitOpts) == 0 { s.explicitOpts = nil </s> remove explicit.Update(dhcpv4.Option{Code: code, Value: val}) </s> add s.explicitOpts.Update(dhcpv4.Option{Code: code, Value: val}) </s> remove return implicit, explicit </s> add </s> remove func prepareOptions(conf V4ServerConf) (implicit, explicit dhcpv4.Options) { </s> add func (s *v4Server) prepareOptions() {
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix.go
if len(s.explicitOpts) == 0 { s.explicitOpts = nil
<mask> <mask> log.Debug("dhcpv4: implicit options:\n%s", implicit.Summary(nil)) <mask> log.Debug("dhcpv4: explicit options:\n%s", explicit.Summary(nil)) <mask> <mask> if len(explicit) == 0 { <mask> explicit = nil <mask> } <mask> <mask> return implicit, explicit <mask> } </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove log.Debug("dhcpv4: implicit options:\n%s", implicit.Summary(nil)) log.Debug("dhcpv4: explicit options:\n%s", explicit.Summary(nil)) </s> add log.Debug("dhcpv4: implicit options:\n%s", s.implicitOpts.Summary(nil)) log.Debug("dhcpv4: explicit options:\n%s", s.explicitOpts.Summary(nil)) </s> remove delete(implicit, code.Code()) </s> add delete(s.implicitOpts, code.Code()) </s> remove return implicit, explicit </s> add </s> remove explicit.Update(dhcpv4.Option{Code: code, Value: val}) </s> add s.explicitOpts.Update(dhcpv4.Option{Code: code, Value: val}) </s> remove }) </s> add }, } t.Run(tc.name, func(t *testing.T) { s.prepareOptions()
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix.go
<mask> <mask> if len(explicit) == 0 { <mask> explicit = nil <mask> } <mask> <mask> return implicit, explicit <mask> } </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove if len(explicit) == 0 { explicit = nil </s> add if len(s.explicitOpts) == 0 { s.explicitOpts = nil </s> remove log.Debug("dhcpv4: implicit options:\n%s", implicit.Summary(nil)) log.Debug("dhcpv4: explicit options:\n%s", explicit.Summary(nil)) </s> add log.Debug("dhcpv4: implicit options:\n%s", s.implicitOpts.Summary(nil)) log.Debug("dhcpv4: explicit options:\n%s", s.explicitOpts.Summary(nil)) </s> remove }) </s> add }, } t.Run(tc.name, func(t *testing.T) { s.prepareOptions() </s> remove v4conf.Enabled = s.conf.Enabled if len(v4conf.RangeStart) == 0 { v4conf.Enabled = false } </s> add </s> remove return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) </s> add if v4conf.Enabled { return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) } log.Error("creating dhcpv4 srv: %s", err)
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix.go
s := &v4Server{ conf: &V4ServerConf{
<mask> }, <mask> }} <mask> <mask> for _, tc := range testCases { <mask> t.Run(tc.name, func(t *testing.T) { <mask> implicit, explicit := prepareOptions(V4ServerConf{ <mask> // Just to avoid nil pointer dereference. <mask> subnet: &net.IPNet{}, <mask> Options: tc.opts, <mask> }) <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove }) </s> add }, } t.Run(tc.name, func(t *testing.T) { s.prepareOptions() </s> remove dhcpServer: &testDHCP{}, </s> add dhcpServer: testDHCP, </s> remove assert.Equal(t, tc.wantExplicit, explicit) </s> add assert.Equal(t, tc.wantExplicit, s.explicitOpts) </s> remove dhcpServer: &testDHCP{}, </s> add dhcpServer: testDHCP, </s> remove for c := range explicit { assert.NotContains(t, implicit, c) </s> add for c := range s.explicitOpts { assert.NotContains(t, s.implicitOpts, c)
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix_test.go
}, } t.Run(tc.name, func(t *testing.T) { s.prepareOptions()
<mask> implicit, explicit := prepareOptions(V4ServerConf{ <mask> // Just to avoid nil pointer dereference. <mask> subnet: &net.IPNet{}, <mask> Options: tc.opts, <mask> }) <mask> <mask> assert.Equal(t, tc.wantExplicit, explicit) <mask> <mask> for c := range explicit { <mask> assert.NotContains(t, implicit, c) </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove assert.Equal(t, tc.wantExplicit, explicit) </s> add assert.Equal(t, tc.wantExplicit, s.explicitOpts) </s> remove t.Run(tc.name, func(t *testing.T) { implicit, explicit := prepareOptions(V4ServerConf{ </s> add s := &v4Server{ conf: &V4ServerConf{ </s> remove for c := range explicit { assert.NotContains(t, implicit, c) </s> add for c := range s.explicitOpts { assert.NotContains(t, s.implicitOpts, c) </s> remove return implicit, explicit </s> add </s> remove if len(explicit) == 0 { explicit = nil </s> add if len(s.explicitOpts) == 0 { s.explicitOpts = nil
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix_test.go
assert.Equal(t, tc.wantExplicit, s.explicitOpts)
<mask> subnet: &net.IPNet{}, <mask> Options: tc.opts, <mask> }) <mask> <mask> assert.Equal(t, tc.wantExplicit, explicit) <mask> <mask> for c := range explicit { <mask> assert.NotContains(t, implicit, c) <mask> } <mask> }) </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove }) </s> add }, } t.Run(tc.name, func(t *testing.T) { s.prepareOptions() </s> remove for c := range explicit { assert.NotContains(t, implicit, c) </s> add for c := range s.explicitOpts { assert.NotContains(t, s.implicitOpts, c) </s> remove t.Run(tc.name, func(t *testing.T) { implicit, explicit := prepareOptions(V4ServerConf{ </s> add s := &v4Server{ conf: &V4ServerConf{ </s> remove return implicit, explicit </s> add </s> remove if len(explicit) == 0 { explicit = nil </s> add if len(s.explicitOpts) == 0 { s.explicitOpts = nil
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix_test.go
for c := range s.explicitOpts { assert.NotContains(t, s.implicitOpts, c)
<mask> }) <mask> <mask> assert.Equal(t, tc.wantExplicit, explicit) <mask> <mask> for c := range explicit { <mask> assert.NotContains(t, implicit, c) <mask> } <mask> }) <mask> } <mask> } </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove assert.Equal(t, tc.wantExplicit, explicit) </s> add assert.Equal(t, tc.wantExplicit, s.explicitOpts) </s> remove }) </s> add }, } t.Run(tc.name, func(t *testing.T) { s.prepareOptions() </s> remove t.Run(tc.name, func(t *testing.T) { implicit, explicit := prepareOptions(V4ServerConf{ </s> add s := &v4Server{ conf: &V4ServerConf{ </s> remove return implicit, explicit </s> add </s> remove if len(explicit) == 0 { explicit = nil </s> add if len(s.explicitOpts) == 0 { s.explicitOpts = nil
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/options_unix_test.go
// type check var _ DHCPServer = winServer{} func (winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (winServer) getLeasesRef() []*Lease { return nil } func (winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (winServer) FindMACbyIP(_ net.IP) (mac net.HardwareAddr) { return nil } func (winServer) WriteDiskConfig4(_ *V4ServerConf) {} func (winServer) WriteDiskConfig6(_ *V6ServerConf) {} func (winServer) Start() (err error) { return nil } func (winServer) Stop() (err error) { return nil } func v4Create(_ *V4ServerConf) (s DHCPServer, err error) { return winServer{}, nil } func v6Create(_ V6ServerConf) (s DHCPServer, err error) { return winServer{}, nil }
<mask> import "net" <mask> <mask> type winServer struct{} <mask> <mask> func (s *winServer) ResetLeases(_ []*Lease) (err error) { return nil } <mask> func (s *winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } <mask> func (s *winServer) getLeasesRef() []*Lease { return nil } <mask> func (s *winServer) AddStaticLease(_ *Lease) (err error) { return nil } <mask> func (s *winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } <mask> func (s *winServer) FindMACbyIP(ip net.IP) (mac net.HardwareAddr) { return nil } <mask> func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} <mask> func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} <mask> func (s *winServer) Start() (err error) { return nil } <mask> func (s *winServer) Stop() (err error) { return nil } <mask> func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } <mask> func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) Stop() (err error) { </s> add func (s *server) Stop() (err error) { </s> remove func (s *Server) Start() (err error) { </s> add func (s *server) Start() (err error) { </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) { </s> remove func (s *Server) Enabled() (ok bool) { </s> add func (s *server) Enabled() (ok bool) { </s> remove func (s *Server) dbLoad() (err error) { </s> add func (s *server) dbLoad() (err error) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dhcpd/v46_windows.go
dhcpServer: testDHCP,
<mask> <mask> for _, tc := range testCases { <mask> t.Run(tc.name, func(t *testing.T) { <mask> s := &Server{ <mask> dhcpServer: &testDHCP{}, <mask> localDomainSuffix: defaultLocalDomainSuffix, <mask> tableHostToIP: hostToIPTable{ <mask> "example." + defaultLocalDomainSuffix: knownIP, <mask> }, <mask> } </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove dhcpServer: &testDHCP{}, </s> add dhcpServer: testDHCP, </s> remove t.Run(tc.name, func(t *testing.T) { implicit, explicit := prepareOptions(V4ServerConf{ </s> add s := &v4Server{ conf: &V4ServerConf{ </s> remove }) </s> add }, } t.Run(tc.name, func(t *testing.T) { s.prepareOptions() </s> remove func (s *Server) notify(flags int) { if len(s.onLeaseChanged) == 0 { return } </s> add func (s *server) notify(flags int) { </s> remove for c := range explicit { assert.NotContains(t, implicit, c) </s> add for c := range s.explicitOpts { assert.NotContains(t, s.implicitOpts, c)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dnsforward/dns_test.go
dhcpServer: testDHCP,
<mask> }} <mask> <mask> for _, tc := range testCases { <mask> s := &Server{ <mask> dhcpServer: &testDHCP{}, <mask> localDomainSuffix: tc.suffix, <mask> tableHostToIP: hostToIPTable{ <mask> "example." + tc.suffix: knownIP, <mask> }, <mask> } </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove dhcpServer: &testDHCP{}, </s> add dhcpServer: testDHCP, </s> remove t.Run(tc.name, func(t *testing.T) { implicit, explicit := prepareOptions(V4ServerConf{ </s> add s := &v4Server{ conf: &V4ServerConf{ </s> remove func (s *Server) notify(flags int) { if len(s.onLeaseChanged) == 0 { return } </s> add func (s *server) notify(flags int) { </s> remove }) </s> add }, } t.Run(tc.name, func(t *testing.T) { s.prepareOptions() </s> remove for c := range explicit { assert.NotContains(t, implicit, c) </s> add for c := range s.explicitOpts { assert.NotContains(t, s.implicitOpts, c)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dnsforward/dns_test.go
dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.Interface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance
<mask> // err := s.Start(nil) // will start listening again, on port 53535, in a goroutine <mask> // <mask> // The zero Server is empty and ready for use. <mask> type Server struct { <mask> dnsProxy *proxy.Proxy // DNS proxy instance <mask> dnsFilter *filtering.DNSFilter // DNS filter instance <mask> dhcpServer dhcpd.ServerInterface // DHCP server instance (optional) <mask> queryLog querylog.QueryLog // Query log instance <mask> stats stats.Interface <mask> access *accessCtx <mask> <mask> // localDomainSuffix is the suffix used to detect internal hosts. It <mask> // must be a valid domain name plus dots on each side. </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove // Server - the current state of the DHCP server type Server struct { srv4 DHCPServer srv6 DHCPServer // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig // Called when the leases DB is modified onLeaseChanged []OnLeaseChangedT } </s> add </s> remove dhcpServer *dhcpd.Server // DHCP module </s> add dhcpServer dhcpd.Interface // DHCP module </s> remove // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. type ServerConfig struct { // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister aghhttp.RegisterFunc `yaml:"-"` Enabled bool `yaml:"enabled"` InterfaceName string `yaml:"interface_name"` // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` Conf4 V4ServerConf `yaml:"dhcpv4"` Conf6 V6ServerConf `yaml:"dhcpv6"` WorkDir string `yaml:"-"` DBFilePath string `yaml:"-"` } </s> add </s> remove var webHandlersRegistered = false </s> add // Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond ) </s> remove if !webHandlersRegistered && s.conf.HTTPRegister != nil { if runtime.GOOS == "windows" { // Our DHCP server doesn't work on Windows yet, so // signal that to the front with an HTTP 501. // // TODO(a.garipov): This needs refactoring. We // shouldn't even try and initialize a DHCP server on // Windows, but there are currently too many // interconnected parts--such as HTTP handlers and // frontend--to make that work properly. s.registerNotImplementedHandlers() } else { s.registerHandlers() } webHandlersRegistered = true } </s> add s.registerHandlers()
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dnsforward/dnsforward.go
DHCPServer dhcpd.Interface
<mask> type DNSCreateParams struct { <mask> DNSFilter *filtering.DNSFilter <mask> Stats stats.Interface <mask> QueryLog querylog.QueryLog <mask> DHCPServer dhcpd.ServerInterface <mask> PrivateNets netutil.SubnetSet <mask> Anonymizer *aghnet.IPMut <mask> LocalDomain string <mask> } <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.ServerInterface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> add dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.Interface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> remove // Server - the current state of the DHCP server type Server struct { srv4 DHCPServer srv6 DHCPServer // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig // Called when the leases DB is modified onLeaseChanged []OnLeaseChangedT } </s> add </s> remove // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. type ServerConfig struct { // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister aghhttp.RegisterFunc `yaml:"-"` Enabled bool `yaml:"enabled"` InterfaceName string `yaml:"interface_name"` // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` Conf4 V4ServerConf `yaml:"dhcpv4"` Conf6 V6ServerConf `yaml:"dhcpv6"` WorkDir string `yaml:"-"` DBFilePath string `yaml:"-"` } </s> add </s> remove func (s *winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (s *winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (s *winServer) getLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) FindMACbyIP(ip net.IP) (mac net.HardwareAddr) { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() (err error) { return nil } func (s *winServer) Stop() (err error) { return nil } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add // type check var _ DHCPServer = winServer{} func (winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (winServer) getLeasesRef() []*Lease { return nil } func (winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (winServer) FindMACbyIP(_ net.IP) (mac net.HardwareAddr) { return nil } func (winServer) WriteDiskConfig4(_ *V4ServerConf) {} func (winServer) WriteDiskConfig6(_ *V6ServerConf) {} func (winServer) Start() (err error) { return nil } func (winServer) Stop() (err error) { return nil } func v4Create(_ *V4ServerConf) (s DHCPServer, err error) { return winServer{}, nil } func v6Create(_ V6ServerConf) (s DHCPServer, err error) { return winServer{}, nil } </s> remove // ServerInterface is an interface for servers. type ServerInterface interface { </s> add // Interface is the DHCP server that deals with both IP address families. type Interface interface { Start() (err error) Stop() (err error)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dnsforward/dnsforward.go
DHCPServer: testDHCP,
<mask> f.SetEnabled(true) <mask> <mask> var err error <mask> s, err = NewServer(DNSCreateParams{ <mask> DHCPServer: &testDHCP{}, <mask> DNSFilter: f, <mask> PrivateNets: netutil.SubnetSetFunc(netutil.IsLocallyServed), <mask> }) <mask> require.NoError(t, err) <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dnsforward/dnsforward_test.go
DHCPServer: testDHCP,
<mask> }} <mask> <mask> f := filtering.New(&filtering.Config{}, filters) <mask> s, err := NewServer(DNSCreateParams{ <mask> DHCPServer: &testDHCP{}, <mask> DNSFilter: f, <mask> PrivateNets: netutil.SubnetSetFunc(netutil.IsLocallyServed), <mask> }) <mask> require.NoError(t, err) <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dnsforward/dnsforward_test.go
DHCPServer: testDHCP,
<mask> f := filtering.New(c, nil) <mask> f.SetEnabled(true) <mask> <mask> s, err := NewServer(DNSCreateParams{ <mask> DHCPServer: &testDHCP{}, <mask> DNSFilter: f, <mask> PrivateNets: netutil.SubnetSetFunc(netutil.IsLocallyServed), <mask> }) <mask> require.NoError(t, err) <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dnsforward/dnsforward_test.go
var testDHCP = &dhcpd.MockInterface{ OnStart: func() (err error) { panic("not implemented") }, OnStop: func() (err error) { panic("not implemented") }, OnEnabled: func() (ok bool) { return true }, OnLeases: func(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { return []*dhcpd.Lease{{ IP: net.IP{192, 168, 12, 34}, HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, Hostname: "myhost", }} }, OnSetOnLeaseChanged: func(olct dhcpd.OnLeaseChangedT) {}, OnFindMACbyIP: func(ip net.IP) (mac net.HardwareAddr) { panic("not implemented") }, OnWriteDiskConfig: func(c *dhcpd.ServerConfig) { panic("not implemented") },
<mask> return nil <mask> } <mask> } <mask> <mask> type testDHCP struct{} <mask> <mask> func (d *testDHCP) Enabled() (ok bool) { return true } <mask> <mask> func (d *testDHCP) Leases(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { <mask> return []*dhcpd.Lease{{ <mask> IP: net.IP{192, 168, 12, 34}, <mask> HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, <mask> Hostname: "myhost", <mask> }} <mask> } <mask> <mask> func (d *testDHCP) SetOnLeaseChanged(onLeaseChanged dhcpd.OnLeaseChangedT) {} <mask> <mask> func TestPTRResponseFromDHCPLeases(t *testing.T) { </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (d *testDHCP) SetOnLeaseChanged(onLeaseChanged dhcpd.OnLeaseChangedT) {} </s> add // func (*testDHCP) Leases(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { // return []*dhcpd.Lease{{ // IP: net.IP{192, 168, 12, 34}, // HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, // Hostname: "myhost", // }} // } </s> remove err = clients.dhcpServer.AddStaticLease(&dhcpd.Lease{ </s> add clients.dhcpServer = dhcpServer err = dhcpServer.AddStaticLease(&dhcpd.Lease{ </s> remove func (s *Server) Enabled() (ok bool) { </s> add func (s *server) Enabled() (ok bool) { </s> remove func (s *winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (s *winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (s *winServer) getLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) FindMACbyIP(ip net.IP) (mac net.HardwareAddr) { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() (err error) { return nil } func (s *winServer) Stop() (err error) { return nil } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add // type check var _ DHCPServer = winServer{} func (winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (winServer) getLeasesRef() []*Lease { return nil } func (winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (winServer) FindMACbyIP(_ net.IP) (mac net.HardwareAddr) { return nil } func (winServer) WriteDiskConfig4(_ *V4ServerConf) {} func (winServer) WriteDiskConfig6(_ *V6ServerConf) {} func (winServer) Start() (err error) { return nil } func (winServer) Stop() (err error) { return nil } func v4Create(_ *V4ServerConf) (s DHCPServer, err error) { return winServer{}, nil } func v6Create(_ V6ServerConf) (s DHCPServer, err error) { return winServer{}, nil } </s> remove // ServerInterface is an interface for servers. type ServerInterface interface { </s> add // Interface is the DHCP server that deals with both IP address families. type Interface interface { Start() (err error) Stop() (err error)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dnsforward/dnsforward_test.go
// func (*testDHCP) Leases(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { // return []*dhcpd.Lease{{ // IP: net.IP{192, 168, 12, 34}, // HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, // Hostname: "myhost", // }} // }
<mask> Hostname: "myhost", <mask> }} <mask> } <mask> <mask> func (d *testDHCP) SetOnLeaseChanged(onLeaseChanged dhcpd.OnLeaseChangedT) {} <mask> <mask> func TestPTRResponseFromDHCPLeases(t *testing.T) { <mask> const localDomain = "lan" <mask> <mask> s, err := NewServer(DNSCreateParams{ </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove type testDHCP struct{} func (d *testDHCP) Enabled() (ok bool) { return true } func (d *testDHCP) Leases(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { return []*dhcpd.Lease{{ IP: net.IP{192, 168, 12, 34}, HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, Hostname: "myhost", }} </s> add var testDHCP = &dhcpd.MockInterface{ OnStart: func() (err error) { panic("not implemented") }, OnStop: func() (err error) { panic("not implemented") }, OnEnabled: func() (ok bool) { return true }, OnLeases: func(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { return []*dhcpd.Lease{{ IP: net.IP{192, 168, 12, 34}, HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, Hostname: "myhost", }} }, OnSetOnLeaseChanged: func(olct dhcpd.OnLeaseChangedT) {}, OnFindMACbyIP: func(ip net.IP) (mac net.HardwareAddr) { panic("not implemented") }, OnWriteDiskConfig: func(c *dhcpd.ServerConfig) { panic("not implemented") }, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove func (s *Server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) { </s> add func (s *server) SetOnLeaseChanged(onLeaseChanged OnLeaseChangedT) { </s> remove func (s *winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (s *winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (s *winServer) getLeasesRef() []*Lease { return nil } func (s *winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (s *winServer) FindMACbyIP(ip net.IP) (mac net.HardwareAddr) { return nil } func (s *winServer) WriteDiskConfig4(c *V4ServerConf) {} func (s *winServer) WriteDiskConfig6(c *V6ServerConf) {} func (s *winServer) Start() (err error) { return nil } func (s *winServer) Stop() (err error) { return nil } func v4Create(conf V4ServerConf) (DHCPServer, error) { return &winServer{}, nil } func v6Create(conf V6ServerConf) (DHCPServer, error) { return &winServer{}, nil } </s> add // type check var _ DHCPServer = winServer{} func (winServer) ResetLeases(_ []*Lease) (err error) { return nil } func (winServer) GetLeases(_ GetLeasesFlags) (leases []*Lease) { return nil } func (winServer) getLeasesRef() []*Lease { return nil } func (winServer) AddStaticLease(_ *Lease) (err error) { return nil } func (winServer) RemoveStaticLease(_ *Lease) (err error) { return nil } func (winServer) FindMACbyIP(_ net.IP) (mac net.HardwareAddr) { return nil } func (winServer) WriteDiskConfig4(_ *V4ServerConf) {} func (winServer) WriteDiskConfig6(_ *V6ServerConf) {} func (winServer) Start() (err error) { return nil } func (winServer) Stop() (err error) { return nil } func v4Create(_ *V4ServerConf) (s DHCPServer, err error) { return winServer{}, nil } func v6Create(_ V6ServerConf) (s DHCPServer, err error) { return winServer{}, nil }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dnsforward/dnsforward_test.go
DHCPServer: testDHCP,
<mask> const localDomain = "lan" <mask> <mask> s, err := NewServer(DNSCreateParams{ <mask> DNSFilter: filtering.New(&filtering.Config{}, nil), <mask> DHCPServer: &testDHCP{}, <mask> PrivateNets: netutil.SubnetSetFunc(netutil.IsLocallyServed), <mask> LocalDomain: localDomain, <mask> }) <mask> require.NoError(t, err) <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dnsforward/dnsforward_test.go
DHCPServer: testDHCP,
<mask> flt.SetEnabled(true) <mask> <mask> var s *Server <mask> s, err = NewServer(DNSCreateParams{ <mask> DHCPServer: &testDHCP{}, <mask> DNSFilter: flt, <mask> PrivateNets: netutil.SubnetSetFunc(netutil.IsLocallyServed), <mask> }) <mask> require.NoError(t, err) <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dnsforward/dnsforward_test.go
DHCPServer: testDHCP,
<mask> f := filtering.New(&filtering.Config{}, filters) <mask> f.SetEnabled(true) <mask> <mask> s, err := NewServer(DNSCreateParams{ <mask> DHCPServer: &testDHCP{}, <mask> DNSFilter: f, <mask> PrivateNets: netutil.SubnetSetFunc(netutil.IsLocallyServed), <mask> }) <mask> require.NoError(t, err) <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP, </s> remove DHCPServer: &testDHCP{}, </s> add DHCPServer: testDHCP,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/dnsforward/filter_test.go
dhcpServer dhcpd.Interface
<mask> <mask> allTags *stringutil.Set <mask> <mask> // dhcpServer is used for looking up clients IP addresses by MAC addresses <mask> dhcpServer *dhcpd.Server <mask> <mask> // dnsServer is used for checking clients IP status access list status <mask> dnsServer *dnsforward.Server <mask> <mask> // etcHosts contains list of rewrite rules taken from the operating system's </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove dhcpServer *dhcpd.Server // DHCP module </s> add dhcpServer dhcpd.Interface // DHCP module </s> remove func (s *Server) Leases(flags GetLeasesFlags) (leases []*Lease) { </s> add func (s *server) Leases(flags GetLeasesFlags) (leases []*Lease) { </s> remove dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.ServerInterface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> add dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.Interface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> remove var webHandlersRegistered = false </s> add // Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond )
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/home/clients.go
dhcpServer dhcpd.Interface,
<mask> // dhcpServer: optional <mask> // Note: this function must be called only once <mask> func (clients *clientsContainer) Init( <mask> objects []*clientObject, <mask> dhcpServer *dhcpd.Server, <mask> etcHosts *aghnet.HostsContainer, <mask> arpdb aghnet.ARPDB, <mask> ) { <mask> if clients.list != nil { <mask> log.Fatal("clients.list != nil") </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove func (s *Server) onNotify(flags uint32) { </s> add func (s *server) onNotify(flags uint32) { </s> remove func (s *Server) Stop() (err error) { </s> add func (s *server) Stop() (err error) { </s> remove dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.ServerInterface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> add dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.Interface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> remove var webHandlersRegistered = false </s> add // Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond ) </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/home/clients.go
<mask> if runtime.GOOS == "windows" { <mask> t.Skip("skipping dhcp test on windows") <mask> } <mask> <mask> var err error <mask> <mask> ip := net.IP{1, 2, 3, 4} <mask> <mask> // First, init a DHCP server with a single static lease. <mask> config := &dhcpd.ServerConfig{ <mask> Enabled: true, </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove if !webHandlersRegistered && s.conf.HTTPRegister != nil { if runtime.GOOS == "windows" { // Our DHCP server doesn't work on Windows yet, so // signal that to the front with an HTTP 501. // // TODO(a.garipov): This needs refactoring. We // shouldn't even try and initialize a DHCP server on // Windows, but there are currently too many // interconnected parts--such as HTTP handlers and // frontend--to make that work properly. s.registerNotImplementedHandlers() } else { s.registerHandlers() } webHandlersRegistered = true } </s> add s.registerHandlers() </s> remove clients.dhcpServer, err = dhcpd.Create(config) </s> add dhcpServer, err := dhcpd.Create(config) </s> remove var webHandlersRegistered = false </s> add // Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond ) </s> remove // Server - the current state of the DHCP server type Server struct { srv4 DHCPServer srv6 DHCPServer // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig // Called when the leases DB is modified onLeaseChanged []OnLeaseChangedT } </s> add </s> remove dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.ServerInterface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> add dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.Interface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/home/clients_test.go
dhcpServer, err := dhcpd.Create(config)
<mask> RangeEnd: net.IP{1, 2, 3, 10}, <mask> }, <mask> } <mask> <mask> clients.dhcpServer, err = dhcpd.Create(config) <mask> require.NoError(t, err) <mask> testutil.CleanupAndRequireSuccess(t, func() (err error) { <mask> return os.Remove("leases.db") <mask> }) <mask> </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove err = clients.dhcpServer.AddStaticLease(&dhcpd.Lease{ </s> add clients.dhcpServer = dhcpServer err = dhcpServer.AddStaticLease(&dhcpd.Lease{ </s> remove var err error </s> add </s> remove type testDHCP struct{} func (d *testDHCP) Enabled() (ok bool) { return true } func (d *testDHCP) Leases(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { return []*dhcpd.Lease{{ IP: net.IP{192, 168, 12, 34}, HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, Hostname: "myhost", }} </s> add var testDHCP = &dhcpd.MockInterface{ OnStart: func() (err error) { panic("not implemented") }, OnStop: func() (err error) { panic("not implemented") }, OnEnabled: func() (ok bool) { return true }, OnLeases: func(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { return []*dhcpd.Lease{{ IP: net.IP{192, 168, 12, 34}, HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, Hostname: "myhost", }} }, OnSetOnLeaseChanged: func(olct dhcpd.OnLeaseChangedT) {}, OnFindMACbyIP: func(ip net.IP) (mac net.HardwareAddr) { panic("not implemented") }, OnWriteDiskConfig: func(c *dhcpd.ServerConfig) { panic("not implemented") }, </s> remove func (s *Server) Stop() (err error) { </s> add func (s *server) Stop() (err error) { </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/home/clients_test.go
clients.dhcpServer = dhcpServer err = dhcpServer.AddStaticLease(&dhcpd.Lease{
<mask> testutil.CleanupAndRequireSuccess(t, func() (err error) { <mask> return os.Remove("leases.db") <mask> }) <mask> <mask> err = clients.dhcpServer.AddStaticLease(&dhcpd.Lease{ <mask> HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, <mask> IP: ip, <mask> Hostname: "testhost", <mask> Expiry: time.Now().Add(time.Hour), <mask> }) </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove type testDHCP struct{} func (d *testDHCP) Enabled() (ok bool) { return true } func (d *testDHCP) Leases(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { return []*dhcpd.Lease{{ IP: net.IP{192, 168, 12, 34}, HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, Hostname: "myhost", }} </s> add var testDHCP = &dhcpd.MockInterface{ OnStart: func() (err error) { panic("not implemented") }, OnStop: func() (err error) { panic("not implemented") }, OnEnabled: func() (ok bool) { return true }, OnLeases: func(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { return []*dhcpd.Lease{{ IP: net.IP{192, 168, 12, 34}, HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, Hostname: "myhost", }} }, OnSetOnLeaseChanged: func(olct dhcpd.OnLeaseChangedT) {}, OnFindMACbyIP: func(ip net.IP) (mac net.HardwareAddr) { panic("not implemented") }, OnWriteDiskConfig: func(c *dhcpd.ServerConfig) { panic("not implemented") }, </s> remove func (d *testDHCP) SetOnLeaseChanged(onLeaseChanged dhcpd.OnLeaseChangedT) {} </s> add // func (*testDHCP) Leases(flags dhcpd.GetLeasesFlags) (leases []*dhcpd.Lease) { // return []*dhcpd.Lease{{ // IP: net.IP{192, 168, 12, 34}, // HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, // Hostname: "myhost", // }} // } </s> remove clients.dhcpServer, err = dhcpd.Create(config) </s> add dhcpServer, err := dhcpd.Create(config) </s> remove func (s *Server) Stop() (err error) { </s> add func (s *server) Stop() (err error) { </s> remove func (s *Server) resetLeases() (err error) { </s> add func (s *server) resetLeases() (err error) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/home/clients_test.go
Context.dhcpServer.WriteDiskConfig(config.DHCP)
<mask> dns.LocalPTRResolvers, config.Clients.Sources.RDNS, dns.UsePrivateRDNS = s.RDNSSettings() <mask> } <mask> <mask> if Context.dhcpServer != nil { <mask> c := &dhcpd.ServerConfig{} <mask> Context.dhcpServer.WriteDiskConfig(c) <mask> config.DHCP = c <mask> } <mask> <mask> config.Clients.Persistent = Context.clients.forConfig() <mask> <mask> configFile := config.getConfigFilename() </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove for c := range explicit { assert.NotContains(t, implicit, c) </s> add for c := range s.explicitOpts { assert.NotContains(t, s.implicitOpts, c) </s> remove v4conf.Enabled = s.conf.Enabled if len(v4conf.RangeStart) == 0 { v4conf.Enabled = false } </s> add </s> remove s.srv4, err = v4Create(v4conf) </s> add v4conf.Enabled = s.conf.Enabled && len(v4conf.RangeStart) != 0 s.srv4, err = v4Create(&v4conf) </s> remove logFilePath := filepath.Join(Context.workDir, ls.File) if filepath.IsAbs(ls.File) { logFilePath = ls.File } _, err := os.OpenFile(logFilePath, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644) if err != nil { log.Fatalf("cannot create a log file: %s", err) </s> add logFilePath := ls.File if !filepath.IsAbs(logFilePath) { logFilePath = filepath.Join(Context.workDir, logFilePath) </s> remove return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) </s> add if v4conf.Enabled { return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) } log.Error("creating dhcpv4 srv: %s", err)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/home/config.go
dhcpServer dhcpd.Interface // DHCP module
<mask> dnsServer *dnsforward.Server // DNS module <mask> rdns *RDNS // rDNS module <mask> whois *WHOIS // WHOIS module <mask> dnsFilter *filtering.DNSFilter // DNS filtering module <mask> dhcpServer *dhcpd.Server // DHCP module <mask> auth *Auth // HTTP authentication module <mask> filters Filtering // DNS filtering module <mask> web *Web // Web (HTTP, HTTPS) module <mask> tls *TLSMod // TLS module <mask> // etcHosts is an IP-hostname pairs set taken from system configuration </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.ServerInterface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> add dnsProxy *proxy.Proxy // DNS proxy instance dnsFilter *filtering.DNSFilter // DNS filter instance dhcpServer dhcpd.Interface // DHCP server instance (optional) queryLog querylog.QueryLog // Query log instance </s> remove dhcpServer *dhcpd.Server </s> add dhcpServer dhcpd.Interface </s> remove // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. type ServerConfig struct { // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister aghhttp.RegisterFunc `yaml:"-"` Enabled bool `yaml:"enabled"` InterfaceName string `yaml:"interface_name"` // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` Conf4 V4ServerConf `yaml:"dhcpv4"` Conf6 V6ServerConf `yaml:"dhcpv6"` WorkDir string `yaml:"-"` DBFilePath string `yaml:"-"` } </s> add </s> remove func prepareOptions(conf V4ServerConf) (implicit, explicit dhcpv4.Options) { </s> add func (s *v4Server) prepareOptions() { </s> remove if !webHandlersRegistered && s.conf.HTTPRegister != nil { if runtime.GOOS == "windows" { // Our DHCP server doesn't work on Windows yet, so // signal that to the front with an HTTP 501. // // TODO(a.garipov): This needs refactoring. We // shouldn't even try and initialize a DHCP server on // Windows, but there are currently too many // interconnected parts--such as HTTP handlers and // frontend--to make that work properly. s.registerNotImplementedHandlers() } else { s.registerHandlers() } webHandlersRegistered = true } </s> add s.registerHandlers()
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/home/home.go
logFilePath := ls.File if !filepath.IsAbs(logFilePath) { logFilePath = filepath.Join(Context.workDir, logFilePath)
<mask> if err != nil { <mask> log.Fatalf("cannot initialize syslog: %s", err) <mask> } <mask> } else { <mask> logFilePath := filepath.Join(Context.workDir, ls.File) <mask> if filepath.IsAbs(ls.File) { <mask> logFilePath = ls.File <mask> } <mask> <mask> _, err := os.OpenFile(logFilePath, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644) <mask> if err != nil { <mask> log.Fatalf("cannot create a log file: %s", err) <mask> } <mask> <mask> log.SetOutput(&lumberjack.Logger{ <mask> Filename: logFilePath, <mask> Compress: ls.Compress, // disabled by default </s> Pull request: 4722 dhcp http panic Merge in DNS/adguard-home from 4722-dhcp-http-panic to master Updates #4722. Squashed commit of the following: commit 8a8db48c3bd4f6bb7fabe65b5b7b162f0986fc76 Merge: 39b344f9 b74b92fc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 20:11:23 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 39b344f97180af17ab22041e5655a27bcc99c29e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 18:33:56 2022 +0300 dhcpd: imp code, fmt commit a36d70d2c25791b2e657e21d6f4681b33497f0cd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:38:17 2022 +0300 dhcpd: imp names, docs commit 600d63da7af62de5cb52fc7670ef28c9f4fe95a7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 17:36:17 2022 +0300 dhcpd: rename files, imp tags commit 44f5507649db8536a07c4c21c8ad6e4a60ba3f43 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:40:26 2022 +0300 dhcpd: add mock commit cfc3cfb714705067d3aa71a7cb5df4245e091cfd Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 16:15:27 2022 +0300 all: use ptr instead of value commit ec526c2cf22df3470641296cfc402113c23c3f9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:57:10 2022 +0300 all: log changes commit 0eca09f4c72bbdc73a2334c839d7781847ba3962 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:32 2022 +0300 dhcpd: let v4 be unconfigured commit 59636e9ff48aea989d7bdfd216b37899b57137d2 Merge: 9238ca0a bc1503af Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 13 14:50:17 2022 +0300 Merge branch 'master' into 4722-dhcp-http-panic commit 9238ca0a1e190ddc344f01959f474932809f086a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Sep 7 18:28:56 2022 +0300 dhcpd: imp conf commit 5f801c9be96c2fa735a50373495d8c6ca2914f32 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Sep 6 16:31:13 2022 +0300 dhcpd: hide behind iface commit a95c2741a7e3e5bfe8775bf937a3709217b76da0 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Aug 31 16:24:02 2022 +0300 dhcpd: separate os files </s> remove return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) </s> add if v4conf.Enabled { return nil, fmt.Errorf("creating dhcpv4 srv: %w", err) } log.Error("creating dhcpv4 srv: %s", err) </s> remove func (s *Server) onNotify(flags uint32) { </s> add func (s *server) onNotify(flags uint32) { </s> remove v4conf.Enabled = s.conf.Enabled if len(v4conf.RangeStart) == 0 { v4conf.Enabled = false } </s> add </s> remove s.srv4, err = v4Create(v4conf) </s> add v4conf.Enabled = s.conf.Enabled && len(v4conf.RangeStart) != 0 s.srv4, err = v4Create(&v4conf) </s> remove explicit = dhcpv4.Options{} for i, o := range conf.Options { </s> add s.explicitOpts = dhcpv4.Options{} for i, o := range s.conf.Options {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/fffa6567585324834eff781a3ddfa4026de3e301
internal/home/home.go
if !strings.Contains(server, "://") { server = "udp://" + server
<mask> nameservers := []dns.NameServer{} <mask> <mask> for idx, server := range servers { <mask> // parse without scheme .e.g 8.8.8.8:53 <mask> if host, err := hostWithDefaultPort(server, "53"); err == nil { <mask> nameservers = append( <mask> nameservers, <mask> dns.NameServer{Addr: host}, <mask> ) <mask> continue <mask> } <mask> <mask> u, err := url.Parse(server) <mask> if err != nil { <mask> return nil, fmt.Errorf("DNS NameServer[%d] format error: %s", idx, err.Error()) </s> Improve: support tcp dns server & return an error when parsing nameserver (#127) </s> remove if u.Scheme != "tls" { </s> add var host, dnsNetType string switch u.Scheme { case "udp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "" // UDP case "tcp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "tcp" // TCP case "tls": host, err = hostWithDefaultPort(u.Host, "853") dnsNetType = "tcp-tls" // DNS over TLS default: </s> remove if fallback, err := parseNameServer(cfg.Fallback); err == nil { dnsCfg.Fallback = fallback </s> add if dnsCfg.Fallback, err = parseNameServer(cfg.Fallback); err != nil { return nil, err </s> remove host, err := hostWithDefaultPort(u.Host, "853") </s> add </s> remove if nameserver, err := parseNameServer(cfg.NameServer); err == nil { dnsCfg.NameServer = nameserver </s> add var err error if dnsCfg.NameServer, err = parseNameServer(cfg.NameServer); err != nil { return nil, err
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/0011c7acfec7f7a8db9e90c150674f5d0bddbcb3
config/config.go
var host, dnsNetType string switch u.Scheme { case "udp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "" // UDP case "tcp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "tcp" // TCP case "tls": host, err = hostWithDefaultPort(u.Host, "853") dnsNetType = "tcp-tls" // DNS over TLS default:
<mask> if err != nil { <mask> return nil, fmt.Errorf("DNS NameServer[%d] format error: %s", idx, err.Error()) <mask> } <mask> <mask> if u.Scheme != "tls" { <mask> return nil, fmt.Errorf("DNS NameServer[%d] unsupport scheme: %s", idx, u.Scheme) <mask> } <mask> <mask> host, err := hostWithDefaultPort(u.Host, "853") <mask> nameservers = append( </s> Improve: support tcp dns server & return an error when parsing nameserver (#127) </s> remove host, err := hostWithDefaultPort(u.Host, "853") </s> add </s> remove if host, err := hostWithDefaultPort(server, "53"); err == nil { nameservers = append( nameservers, dns.NameServer{Addr: host}, ) continue </s> add if !strings.Contains(server, "://") { server = "udp://" + server </s> remove if fallback, err := parseNameServer(cfg.Fallback); err == nil { dnsCfg.Fallback = fallback </s> add if dnsCfg.Fallback, err = parseNameServer(cfg.Fallback); err != nil { return nil, err </s> remove if nameserver, err := parseNameServer(cfg.NameServer); err == nil { dnsCfg.NameServer = nameserver </s> add var err error if dnsCfg.NameServer, err = parseNameServer(cfg.NameServer); err != nil { return nil, err
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/0011c7acfec7f7a8db9e90c150674f5d0bddbcb3
config/config.go
if err != nil { return nil, fmt.Errorf("DNS NameServer[%d] format error: %s", idx, err.Error()) }
<mask> dnsNetType = "tcp-tls" // DNS over TLS <mask> default: <mask> return nil, fmt.Errorf("DNS NameServer[%d] unsupport scheme: %s", idx, u.Scheme) <mask> } <mask> <mask> nameservers = append( <mask> nameservers, <mask> dns.NameServer{ <mask> Net: dnsNetType, <mask> Addr: host, </s> Improve: support tcp dns server & return an error when parsing nameserver (#127) </s> remove if u.Scheme != "tls" { </s> add var host, dnsNetType string switch u.Scheme { case "udp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "" // UDP case "tcp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "tcp" // TCP case "tls": host, err = hostWithDefaultPort(u.Host, "853") dnsNetType = "tcp-tls" // DNS over TLS default: </s> remove host, err := hostWithDefaultPort(u.Host, "853") </s> add </s> remove Net: "tcp-tls", </s> add Net: dnsNetType, </s> remove if host, err := hostWithDefaultPort(server, "53"); err == nil { nameservers = append( nameservers, dns.NameServer{Addr: host}, ) continue </s> add if !strings.Contains(server, "://") { server = "udp://" + server </s> remove if fallback, err := parseNameServer(cfg.Fallback); err == nil { dnsCfg.Fallback = fallback </s> add if dnsCfg.Fallback, err = parseNameServer(cfg.Fallback); err != nil { return nil, err
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/0011c7acfec7f7a8db9e90c150674f5d0bddbcb3
config/config.go
<mask> if u.Scheme != "tls" { <mask> return nil, fmt.Errorf("DNS NameServer[%d] unsupport scheme: %s", idx, u.Scheme) <mask> } <mask> <mask> host, err := hostWithDefaultPort(u.Host, "853") <mask> nameservers = append( <mask> nameservers, <mask> dns.NameServer{ <mask> Net: "tcp-tls", <mask> Addr: host, </s> Improve: support tcp dns server & return an error when parsing nameserver (#127) </s> remove if u.Scheme != "tls" { </s> add var host, dnsNetType string switch u.Scheme { case "udp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "" // UDP case "tcp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "tcp" // TCP case "tls": host, err = hostWithDefaultPort(u.Host, "853") dnsNetType = "tcp-tls" // DNS over TLS default: </s> remove Net: "tcp-tls", </s> add Net: dnsNetType, </s> remove if host, err := hostWithDefaultPort(server, "53"); err == nil { nameservers = append( nameservers, dns.NameServer{Addr: host}, ) continue </s> add if !strings.Contains(server, "://") { server = "udp://" + server </s> remove if fallback, err := parseNameServer(cfg.Fallback); err == nil { dnsCfg.Fallback = fallback </s> add if dnsCfg.Fallback, err = parseNameServer(cfg.Fallback); err != nil { return nil, err
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/0011c7acfec7f7a8db9e90c150674f5d0bddbcb3
config/config.go
Net: dnsNetType,
<mask> host, err := hostWithDefaultPort(u.Host, "853") <mask> nameservers = append( <mask> nameservers, <mask> dns.NameServer{ <mask> Net: "tcp-tls", <mask> Addr: host, <mask> }, <mask> ) <mask> } <mask> </s> Improve: support tcp dns server & return an error when parsing nameserver (#127) </s> remove host, err := hostWithDefaultPort(u.Host, "853") </s> add </s> remove if host, err := hostWithDefaultPort(server, "53"); err == nil { nameservers = append( nameservers, dns.NameServer{Addr: host}, ) continue </s> add if !strings.Contains(server, "://") { server = "udp://" + server </s> remove if u.Scheme != "tls" { </s> add var host, dnsNetType string switch u.Scheme { case "udp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "" // UDP case "tcp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "tcp" // TCP case "tls": host, err = hostWithDefaultPort(u.Host, "853") dnsNetType = "tcp-tls" // DNS over TLS default: </s> remove if fallback, err := parseNameServer(cfg.Fallback); err == nil { dnsCfg.Fallback = fallback </s> add if dnsCfg.Fallback, err = parseNameServer(cfg.Fallback); err != nil { return nil, err
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/0011c7acfec7f7a8db9e90c150674f5d0bddbcb3
config/config.go
var err error if dnsCfg.NameServer, err = parseNameServer(cfg.NameServer); err != nil { return nil, err
<mask> Enable: cfg.Enable, <mask> Listen: cfg.Listen, <mask> EnhancedMode: cfg.EnhancedMode, <mask> } <mask> <mask> if nameserver, err := parseNameServer(cfg.NameServer); err == nil { <mask> dnsCfg.NameServer = nameserver <mask> } <mask> <mask> if fallback, err := parseNameServer(cfg.Fallback); err == nil { <mask> dnsCfg.Fallback = fallback <mask> } </s> Improve: support tcp dns server & return an error when parsing nameserver (#127) </s> remove if fallback, err := parseNameServer(cfg.Fallback); err == nil { dnsCfg.Fallback = fallback </s> add if dnsCfg.Fallback, err = parseNameServer(cfg.Fallback); err != nil { return nil, err </s> remove if host, err := hostWithDefaultPort(server, "53"); err == nil { nameservers = append( nameservers, dns.NameServer{Addr: host}, ) continue </s> add if !strings.Contains(server, "://") { server = "udp://" + server </s> remove if u.Scheme != "tls" { </s> add var host, dnsNetType string switch u.Scheme { case "udp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "" // UDP case "tcp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "tcp" // TCP case "tls": host, err = hostWithDefaultPort(u.Host, "853") dnsNetType = "tcp-tls" // DNS over TLS default: </s> remove host, err := hostWithDefaultPort(u.Host, "853") </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/0011c7acfec7f7a8db9e90c150674f5d0bddbcb3
config/config.go
if dnsCfg.Fallback, err = parseNameServer(cfg.Fallback); err != nil { return nil, err
<mask> if nameserver, err := parseNameServer(cfg.NameServer); err == nil { <mask> dnsCfg.NameServer = nameserver <mask> } <mask> <mask> if fallback, err := parseNameServer(cfg.Fallback); err == nil { <mask> dnsCfg.Fallback = fallback <mask> } <mask> <mask> return dnsCfg, nil <mask> } </s> Improve: support tcp dns server & return an error when parsing nameserver (#127) </s> remove if nameserver, err := parseNameServer(cfg.NameServer); err == nil { dnsCfg.NameServer = nameserver </s> add var err error if dnsCfg.NameServer, err = parseNameServer(cfg.NameServer); err != nil { return nil, err </s> remove if host, err := hostWithDefaultPort(server, "53"); err == nil { nameservers = append( nameservers, dns.NameServer{Addr: host}, ) continue </s> add if !strings.Contains(server, "://") { server = "udp://" + server </s> remove if u.Scheme != "tls" { </s> add var host, dnsNetType string switch u.Scheme { case "udp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "" // UDP case "tcp": host, err = hostWithDefaultPort(u.Host, "53") dnsNetType = "tcp" // TCP case "tls": host, err = hostWithDefaultPort(u.Host, "853") dnsNetType = "tcp-tls" // DNS over TLS default: </s> remove host, err := hostWithDefaultPort(u.Host, "853") </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/0011c7acfec7f7a8db9e90c150674f5d0bddbcb3
config/config.go
"math/bits"
<mask> // https://github.com/spaolacci/murmur3/blob/master/murmur32.go <mask> <mask> import ( <mask> "hash" <mask> "unsafe" <mask> ) <mask> <mask> // Make sure interfaces are correctly implemented. </s> Style: fix go vet warning </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13) </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15)
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/016e7bd0b45a9ce2507262b870edd62abb985fb4
common/murmur3/murmur32.go
k1 = bits.RotateLeft32(k1, 15)
<mask> for i := 0; i < nblocks; i++ { <mask> k1 := *(*uint32)(unsafe.Pointer(&p[i*4])) <mask> <mask> k1 *= c1_32 <mask> k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) <mask> k1 *= c2_32 <mask> <mask> h1 ^= k1 <mask> h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) <mask> h1 = h1*4 + h1 + 0xe6546b64 </s> Style: fix go vet warning </s> remove var p uintptr if len(data) > 0 { p = uintptr(unsafe.Pointer(&data[0])) } p1 := p + uintptr(4*nblocks) for ; p < p1; p += 4 { k1 := *(*uint32)(unsafe.Pointer(p)) </s> add for i := 0; i < nblocks; i++ { k1 := *(*uint32)(unsafe.Pointer(&data[i*4])) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13) </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/016e7bd0b45a9ce2507262b870edd62abb985fb4
common/murmur3/murmur32.go
h1 = bits.RotateLeft32(h1, 13)
<mask> k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) <mask> k1 *= c2_32 <mask> <mask> h1 ^= k1 <mask> h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) <mask> h1 = h1*4 + h1 + 0xe6546b64 <mask> } <mask> d.h1 = h1 <mask> return p[nblocks*d.Size():] <mask> } </s> Style: fix go vet warning </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/016e7bd0b45a9ce2507262b870edd62abb985fb4
common/murmur3/murmur32.go
k1 = bits.RotateLeft32(k1, 15)
<mask> fallthrough <mask> case 1: <mask> k1 ^= uint32(d.tail[0]) <mask> k1 *= c1_32 <mask> k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) <mask> k1 *= c2_32 <mask> h1 ^= k1 <mask> } <mask> <mask> h1 ^= uint32(d.clen) </s> Style: fix go vet warning </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13) </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/016e7bd0b45a9ce2507262b870edd62abb985fb4
common/murmur3/murmur32.go
for i := 0; i < nblocks; i++ { k1 := *(*uint32)(unsafe.Pointer(&data[i*4]))
<mask> func Sum32WithSeed(data []byte, seed uint32) uint32 { <mask> h1 := seed <mask> <mask> nblocks := len(data) / 4 <mask> var p uintptr <mask> if len(data) > 0 { <mask> p = uintptr(unsafe.Pointer(&data[0])) <mask> } <mask> p1 := p + uintptr(4*nblocks) <mask> for ; p < p1; p += 4 { <mask> k1 := *(*uint32)(unsafe.Pointer(p)) <mask> <mask> k1 *= c1_32 <mask> k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) <mask> k1 *= c2_32 <mask> </s> Style: fix go vet warning </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/016e7bd0b45a9ce2507262b870edd62abb985fb4
common/murmur3/murmur32.go
k1 = bits.RotateLeft32(k1, 15)
<mask> for ; p < p1; p += 4 { <mask> k1 := *(*uint32)(unsafe.Pointer(p)) <mask> <mask> k1 *= c1_32 <mask> k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) <mask> k1 *= c2_32 <mask> <mask> h1 ^= k1 <mask> h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) <mask> h1 = h1*4 + h1 + 0xe6546b64 </s> Style: fix go vet warning </s> remove var p uintptr if len(data) > 0 { p = uintptr(unsafe.Pointer(&data[0])) } p1 := p + uintptr(4*nblocks) for ; p < p1; p += 4 { k1 := *(*uint32)(unsafe.Pointer(p)) </s> add for i := 0; i < nblocks; i++ { k1 := *(*uint32)(unsafe.Pointer(&data[i*4])) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13) </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/016e7bd0b45a9ce2507262b870edd62abb985fb4
common/murmur3/murmur32.go
h1 = bits.RotateLeft32(h1, 13)
<mask> k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) <mask> k1 *= c2_32 <mask> <mask> h1 ^= k1 <mask> h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) <mask> h1 = h1*4 + h1 + 0xe6546b64 <mask> } <mask> <mask> tail := data[nblocks*4:] <mask> </s> Style: fix go vet warning </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/016e7bd0b45a9ce2507262b870edd62abb985fb4
common/murmur3/murmur32.go
k1 = bits.RotateLeft32(k1, 15)
<mask> fallthrough <mask> case 1: <mask> k1 ^= uint32(tail[0]) <mask> k1 *= c1_32 <mask> k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) <mask> k1 *= c2_32 <mask> h1 ^= k1 <mask> } <mask> <mask> h1 ^= uint32(len(data)) </s> Style: fix go vet warning </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove k1 = (k1 << 15) | (k1 >> 17) // rotl32(k1, 15) </s> add k1 = bits.RotateLeft32(k1, 15) </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13) </s> remove h1 = (h1 << 13) | (h1 >> 19) // rotl32(h1, 13) </s> add h1 = bits.RotateLeft32(h1, 13)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/016e7bd0b45a9ce2507262b870edd62abb985fb4
common/murmur3/murmur32.go
darwin-amd64-v3 \
<mask> <mask> PLATFORM_LIST = \ <mask> darwin-amd64 \ <mask> darwin-arm64 \ <mask> linux-386 \ <mask> linux-amd64 \ <mask> linux-amd64-v3 \ <mask> linux-armv5 \ </s> Chore: split amd64 v3 to special release
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/02333a859a57ddb528eb469f734ebc2669911ee9
Makefile
linux-amd64-v3 \
<mask> darwin-arm64 \ <mask> linux-386 \ <mask> linux-amd64 \ <mask> linux-armv5 \ <mask> linux-armv6 \ <mask> linux-armv7 \ <mask> linux-armv8 \ <mask> linux-mips-softfloat \ <mask> linux-mips-hardfloat \ </s> Chore: split amd64 v3 to special release
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/02333a859a57ddb528eb469f734ebc2669911ee9
Makefile
freebsd-amd64-v3 \
<mask> freebsd-386 \ <mask> freebsd-amd64 \ <mask> freebsd-arm64 <mask> <mask> WINDOWS_ARCH_LIST = \ <mask> windows-386 \ </s> Chore: split amd64 v3 to special release
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/02333a859a57ddb528eb469f734ebc2669911ee9
Makefile
windows-amd64-v3 \
<mask> WINDOWS_ARCH_LIST = \ <mask> windows-386 \ <mask> windows-amd64 \ <mask> windows-arm64 \ <mask> windows-arm32v7 <mask> <mask> all: linux-amd64 darwin-amd64 windows-amd64 # Most used <mask> <mask> docker: </s> Chore: split amd64 v3 to special release
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/02333a859a57ddb528eb469f734ebc2669911ee9
Makefile
GOARCH=amd64 GOOS=darwin $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ darwin-amd64-v3:
<mask> <mask> darwin-amd64: <mask> GOARCH=amd64 GOOS=darwin GOAMD64=v3 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ <mask> <mask> darwin-arm64: <mask> GOARCH=arm64 GOOS=darwin $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ <mask> <mask> linux-386: </s> Chore: split amd64 v3 to special release
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/02333a859a57ddb528eb469f734ebc2669911ee9
Makefile
GOARCH=amd64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ linux-amd64-v3:
<mask> GOARCH=386 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ <mask> <mask> linux-amd64: <mask> GOARCH=amd64 GOOS=linux GOAMD64=v3 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ <mask> <mask> linux-armv5: <mask> GOARCH=arm GOOS=linux GOARM=5 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ <mask> </s> Chore: split amd64 v3 to special release
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/02333a859a57ddb528eb469f734ebc2669911ee9
Makefile
GOARCH=amd64 GOOS=freebsd $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ freebsd-amd64-v3:
<mask> freebsd-386: <mask> GOARCH=386 GOOS=freebsd $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ <mask> <mask> freebsd-amd64: <mask> GOARCH=amd64 GOOS=freebsd GOAMD64=v3 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ <mask> <mask> freebsd-arm64: <mask> GOARCH=arm64 GOOS=freebsd $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ <mask> </s> Chore: split amd64 v3 to special release
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/02333a859a57ddb528eb469f734ebc2669911ee9
Makefile
GOARCH=amd64 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe windows-amd64-v3:
<mask> GOARCH=386 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe <mask> <mask> windows-amd64: <mask> GOARCH=amd64 GOOS=windows GOAMD64=v3 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe <mask> <mask> windows-arm64: <mask> GOARCH=arm64 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe <mask> </s> Chore: split amd64 v3 to special release
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/02333a859a57ddb528eb469f734ebc2669911ee9
Makefile
WSOpts WSOptions `proxy:"ws-opts,omitempty"`
<mask> Network string `proxy:"network,omitempty"` <mask> HTTPOpts HTTPOptions `proxy:"http-opts,omitempty"` <mask> HTTP2Opts HTTP2Options `proxy:"h2-opts,omitempty"` <mask> GrpcOpts GrpcOptions `proxy:"grpc-opts,omitempty"` <mask> WSPath string `proxy:"ws-path,omitempty"` <mask> WSHeaders map[string]string `proxy:"ws-headers,omitempty"` <mask> SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` <mask> ServerName string `proxy:"servername,omitempty"` </s> Feature: add vmess WebSocket early data (#1505) Co-authored-by: ShinyGwyn <79344143+ShinyGwyn@users.noreply.github.com> </s> remove Host string Port string Path string Headers http.Header TLS bool SkipCertVerify bool ServerName string </s> add Host string Port string Path string Headers http.Header TLS bool SkipCertVerify bool ServerName string MaxEarlyData int EarlyDataHeaderName string </s> remove func StreamWebsocketConn(conn net.Conn, c *WebsocketConfig) (net.Conn, error) { </s> add func (wsedc *websocketWithEarlyDataConn) Dial(earlyData []byte) error { earlyDataBuf := bytes.NewBuffer(nil) base64EarlyDataEncoder := base64.NewEncoder(base64.RawURLEncoding, earlyDataBuf) earlydata := bytes.NewReader(earlyData) limitedEarlyDatareader := io.LimitReader(earlydata, int64(wsedc.config.MaxEarlyData)) n, encerr := io.Copy(base64EarlyDataEncoder, limitedEarlyDatareader) if encerr != nil { return errors.New("failed to encode early data: " + encerr.Error()) } if errc := base64EarlyDataEncoder.Close(); errc != nil { return errors.New("failed to encode early data tail: " + errc.Error()) } var err error if wsedc.Conn, err = streamWebsocketConn(wsedc.underlay, wsedc.config, earlyDataBuf); err != nil { wsedc.Close() return errors.New("failed to dial WebSocket: " + err.Error()) } wsedc.dialed <- true if n != int64(len(earlyData)) { _, err = wsedc.Conn.Write(earlyData[n:]) } return err } func (wsedc *websocketWithEarlyDataConn) Write(b []byte) (int, error) { if wsedc.closed { return 0, io.ErrClosedPipe } if wsedc.Conn == nil { if err := wsedc.Dial(b); err != nil { return 0, err } return len(b), nil } return wsedc.Conn.Write(b) } func (wsedc *websocketWithEarlyDataConn) Read(b []byte) (int, error) { if wsedc.closed { return 0, io.ErrClosedPipe } if wsedc.Conn == nil { select { case <-wsedc.ctx.Done(): return 0, io.ErrUnexpectedEOF case <-wsedc.dialed: } } return wsedc.Conn.Read(b) } func (wsedc *websocketWithEarlyDataConn) Close() error { wsedc.closed = true wsedc.cancel() if wsedc.Conn == nil { return nil } return wsedc.Conn.Close() } func (wsedc *websocketWithEarlyDataConn) LocalAddr() net.Addr { if wsedc.Conn == nil { return wsedc.underlay.LocalAddr() } return wsedc.Conn.LocalAddr() } func (wsedc *websocketWithEarlyDataConn) RemoteAddr() net.Addr { if wsedc.Conn == nil { return wsedc.underlay.RemoteAddr() } return wsedc.Conn.RemoteAddr() } func (wsedc *websocketWithEarlyDataConn) SetDeadline(t time.Time) error { if err := wsedc.SetReadDeadline(t); err != nil { return err } return wsedc.SetWriteDeadline(t) } func (wsedc *websocketWithEarlyDataConn) SetReadDeadline(t time.Time) error { if wsedc.Conn == nil { return nil } return wsedc.Conn.SetReadDeadline(t) } func (wsedc *websocketWithEarlyDataConn) SetWriteDeadline(t time.Time) error { if wsedc.Conn == nil { return nil } return wsedc.Conn.SetWriteDeadline(t) } func streamWebsocketWithEarlyDataConn(conn net.Conn, c *WebsocketConfig) (net.Conn, error) { ctx, cancel := context.WithCancel(context.Background()) conn = &websocketWithEarlyDataConn{ dialed: make(chan bool, 1), cancel: cancel, ctx: ctx, underlay: conn, config: c, } return conn, nil } func streamWebsocketConn(conn net.Conn, c *WebsocketConfig, earlyData *bytes.Buffer) (net.Conn, error) {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/0267b2efad9a6b0f447efde20589e124ad369a15
adapter/outbound/vmess.go
type WSOptions struct { Path string `proxy:"path,omitempty"` Headers map[string]string `proxy:"headers,omitempty"` MaxEarlyData int `proxy:"max-early-data,omitempty"` EarlyDataHeaderName string `proxy:"early-data-header-name,omitempty"` }
<mask> GrpcServiceName string `proxy:"grpc-service-name,omitempty"` <mask> } <mask> <mask> // StreamConn implements C.ProxyAdapter <mask> func (v *Vmess) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error) { <mask> var err error <mask> switch v.option.Network { <mask> case "ws": <mask> if v.option.WSOpts.Path == "" { </s> Feature: add vmess WebSocket early data (#1505) Co-authored-by: ShinyGwyn <79344143+ShinyGwyn@users.noreply.github.com> </s> remove func StreamWebsocketConn(conn net.Conn, c *WebsocketConfig) (net.Conn, error) { </s> add func (wsedc *websocketWithEarlyDataConn) Dial(earlyData []byte) error { earlyDataBuf := bytes.NewBuffer(nil) base64EarlyDataEncoder := base64.NewEncoder(base64.RawURLEncoding, earlyDataBuf) earlydata := bytes.NewReader(earlyData) limitedEarlyDatareader := io.LimitReader(earlydata, int64(wsedc.config.MaxEarlyData)) n, encerr := io.Copy(base64EarlyDataEncoder, limitedEarlyDatareader) if encerr != nil { return errors.New("failed to encode early data: " + encerr.Error()) } if errc := base64EarlyDataEncoder.Close(); errc != nil { return errors.New("failed to encode early data tail: " + errc.Error()) } var err error if wsedc.Conn, err = streamWebsocketConn(wsedc.underlay, wsedc.config, earlyDataBuf); err != nil { wsedc.Close() return errors.New("failed to dial WebSocket: " + err.Error()) } wsedc.dialed <- true if n != int64(len(earlyData)) { _, err = wsedc.Conn.Write(earlyData[n:]) } return err } func (wsedc *websocketWithEarlyDataConn) Write(b []byte) (int, error) { if wsedc.closed { return 0, io.ErrClosedPipe } if wsedc.Conn == nil { if err := wsedc.Dial(b); err != nil { return 0, err } return len(b), nil } return wsedc.Conn.Write(b) } func (wsedc *websocketWithEarlyDataConn) Read(b []byte) (int, error) { if wsedc.closed { return 0, io.ErrClosedPipe } if wsedc.Conn == nil { select { case <-wsedc.ctx.Done(): return 0, io.ErrUnexpectedEOF case <-wsedc.dialed: } } return wsedc.Conn.Read(b) } func (wsedc *websocketWithEarlyDataConn) Close() error { wsedc.closed = true wsedc.cancel() if wsedc.Conn == nil { return nil } return wsedc.Conn.Close() } func (wsedc *websocketWithEarlyDataConn) LocalAddr() net.Addr { if wsedc.Conn == nil { return wsedc.underlay.LocalAddr() } return wsedc.Conn.LocalAddr() } func (wsedc *websocketWithEarlyDataConn) RemoteAddr() net.Addr { if wsedc.Conn == nil { return wsedc.underlay.RemoteAddr() } return wsedc.Conn.RemoteAddr() } func (wsedc *websocketWithEarlyDataConn) SetDeadline(t time.Time) error { if err := wsedc.SetReadDeadline(t); err != nil { return err } return wsedc.SetWriteDeadline(t) } func (wsedc *websocketWithEarlyDataConn) SetReadDeadline(t time.Time) error { if wsedc.Conn == nil { return nil } return wsedc.Conn.SetReadDeadline(t) } func (wsedc *websocketWithEarlyDataConn) SetWriteDeadline(t time.Time) error { if wsedc.Conn == nil { return nil } return wsedc.Conn.SetWriteDeadline(t) } func streamWebsocketWithEarlyDataConn(conn net.Conn, c *WebsocketConfig) (net.Conn, error) { ctx, cancel := context.WithCancel(context.Background()) conn = &websocketWithEarlyDataConn{ dialed: make(chan bool, 1), cancel: cancel, ctx: ctx, underlay: conn, config: c, } return conn, nil } func streamWebsocketConn(conn net.Conn, c *WebsocketConfig, earlyData *bytes.Buffer) (net.Conn, error) { </s> remove Host string Port string Path string Headers http.Header TLS bool SkipCertVerify bool ServerName string </s> add Host string Port string Path string Headers http.Header TLS bool SkipCertVerify bool ServerName string MaxEarlyData int EarlyDataHeaderName string </s> remove Host: host, Port: port, Path: v.option.WSPath, </s> add Host: host, Port: port, Path: v.option.WSOpts.Path, MaxEarlyData: v.option.WSOpts.MaxEarlyData, EarlyDataHeaderName: v.option.WSOpts.EarlyDataHeaderName,
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/0267b2efad9a6b0f447efde20589e124ad369a15
adapter/outbound/vmess.go
if v.option.WSOpts.Path == "" { v.option.WSOpts.Path = v.option.WSPath } if len(v.option.WSOpts.Headers) == 0 { v.option.WSOpts.Headers = v.option.WSHeaders }
<mask> func (v *Vmess) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error) { <mask> var err error <mask> switch v.option.Network { <mask> case "ws": <mask> host, port, _ := net.SplitHostPort(v.addr) <mask> wsOpts := &vmess.WebsocketConfig{ <mask> Host: host, <mask> Port: port, </s> Feature: add vmess WebSocket early data (#1505) Co-authored-by: ShinyGwyn <79344143+ShinyGwyn@users.noreply.github.com> </s> remove Host: host, Port: port, Path: v.option.WSPath, </s> add Host: host, Port: port, Path: v.option.WSOpts.Path, MaxEarlyData: v.option.WSOpts.MaxEarlyData, EarlyDataHeaderName: v.option.WSOpts.EarlyDataHeaderName, </s> remove func StreamWebsocketConn(conn net.Conn, c *WebsocketConfig) (net.Conn, error) { </s> add func (wsedc *websocketWithEarlyDataConn) Dial(earlyData []byte) error { earlyDataBuf := bytes.NewBuffer(nil) base64EarlyDataEncoder := base64.NewEncoder(base64.RawURLEncoding, earlyDataBuf) earlydata := bytes.NewReader(earlyData) limitedEarlyDatareader := io.LimitReader(earlydata, int64(wsedc.config.MaxEarlyData)) n, encerr := io.Copy(base64EarlyDataEncoder, limitedEarlyDatareader) if encerr != nil { return errors.New("failed to encode early data: " + encerr.Error()) } if errc := base64EarlyDataEncoder.Close(); errc != nil { return errors.New("failed to encode early data tail: " + errc.Error()) } var err error if wsedc.Conn, err = streamWebsocketConn(wsedc.underlay, wsedc.config, earlyDataBuf); err != nil { wsedc.Close() return errors.New("failed to dial WebSocket: " + err.Error()) } wsedc.dialed <- true if n != int64(len(earlyData)) { _, err = wsedc.Conn.Write(earlyData[n:]) } return err } func (wsedc *websocketWithEarlyDataConn) Write(b []byte) (int, error) { if wsedc.closed { return 0, io.ErrClosedPipe } if wsedc.Conn == nil { if err := wsedc.Dial(b); err != nil { return 0, err } return len(b), nil } return wsedc.Conn.Write(b) } func (wsedc *websocketWithEarlyDataConn) Read(b []byte) (int, error) { if wsedc.closed { return 0, io.ErrClosedPipe } if wsedc.Conn == nil { select { case <-wsedc.ctx.Done(): return 0, io.ErrUnexpectedEOF case <-wsedc.dialed: } } return wsedc.Conn.Read(b) } func (wsedc *websocketWithEarlyDataConn) Close() error { wsedc.closed = true wsedc.cancel() if wsedc.Conn == nil { return nil } return wsedc.Conn.Close() } func (wsedc *websocketWithEarlyDataConn) LocalAddr() net.Addr { if wsedc.Conn == nil { return wsedc.underlay.LocalAddr() } return wsedc.Conn.LocalAddr() } func (wsedc *websocketWithEarlyDataConn) RemoteAddr() net.Addr { if wsedc.Conn == nil { return wsedc.underlay.RemoteAddr() } return wsedc.Conn.RemoteAddr() } func (wsedc *websocketWithEarlyDataConn) SetDeadline(t time.Time) error { if err := wsedc.SetReadDeadline(t); err != nil { return err } return wsedc.SetWriteDeadline(t) } func (wsedc *websocketWithEarlyDataConn) SetReadDeadline(t time.Time) error { if wsedc.Conn == nil { return nil } return wsedc.Conn.SetReadDeadline(t) } func (wsedc *websocketWithEarlyDataConn) SetWriteDeadline(t time.Time) error { if wsedc.Conn == nil { return nil } return wsedc.Conn.SetWriteDeadline(t) } func streamWebsocketWithEarlyDataConn(conn net.Conn, c *WebsocketConfig) (net.Conn, error) { ctx, cancel := context.WithCancel(context.Background()) conn = &websocketWithEarlyDataConn{ dialed: make(chan bool, 1), cancel: cancel, ctx: ctx, underlay: conn, config: c, } return conn, nil } func streamWebsocketConn(conn net.Conn, c *WebsocketConfig, earlyData *bytes.Buffer) (net.Conn, error) { </s> remove if len(v.option.WSHeaders) != 0 { </s> add if len(v.option.WSOpts.Headers) != 0 { </s> remove if _, err := vc.Conn.Write(h.Sum(nil)); err != nil { return err } </s> add mbuf.Write(h.Sum(nil))
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/Dreamacro/clash/commit/0267b2efad9a6b0f447efde20589e124ad369a15
adapter/outbound/vmess.go