docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep keep keep replace replace keep replace keep keep keep keep
<mask> <mask> return s.stopLocked() <mask> } <mask> <mask> // stopLocked stops the DNS server without locking. For internal use only. <mask> func (s *Server) stopLocked() error { <mask> if s.dnsProxy != nil { <mask> err := s.dnsProxy.Stop() <mask> if err != nil { <mask> return fmt.Errorf("could not stop the DNS server properly: %w", err) <mask> } <mask> } </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> remove return fmt.Errorf("could not stop the DNS server properly: %w", err) </s> add errs = append(errs, fmt.Errorf("could not stop local resolvers properly: %w", err)) </s> remove s.isRunning = false </s> add if len(errs) > 0 { return errors.List("stopping DNS server", errs...) } else { s.isRunning = false } </s> remove return fmt.Errorf("couldn't stop forwarding DNS server: %w", err) </s> add return fmt.Errorf("stopping forwarding dns server: %w", err) } err = Context.clients.Close() if err != nil { return fmt.Errorf("closing clients container: %w", err) </s> remove err := Context.dnsServer.Stop() </s> add err = Context.dnsServer.Stop() </s> add // closeUpstreams closes the client-specific upstream config of c if any. func (c *Client) closeUpstreams() (err error) { if c.upstreamConfig != nil { err = c.upstreamConfig.Close() if err != nil { return fmt.Errorf("closing upstreams of client %q: %w", c.Name, err) } } return nil }
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/dnsforward/dnsforward.go
keep keep keep keep replace keep keep keep replace keep keep keep keep
<mask> func (s *Server) stopLocked() error { <mask> if s.dnsProxy != nil { <mask> err := s.dnsProxy.Stop() <mask> if err != nil { <mask> return fmt.Errorf("could not stop the DNS server properly: %w", err) <mask> } <mask> } <mask> <mask> s.isRunning = false <mask> return nil <mask> } <mask> <mask> // IsRunning returns true if the DNS server is running. </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> remove // stopLocked stops the DNS server without locking. For internal use only. func (s *Server) stopLocked() error { </s> add // stopLocked stops the DNS server without locking. For internal use only. func (s *Server) stopLocked() (err error) { var errs []error </s> remove err := s.dnsProxy.Stop() </s> add err = s.dnsProxy.Stop() if err != nil { errs = append(errs, fmt.Errorf("could not stop primary resolvers properly: %w", err)) } } if s.internalProxy != nil && s.internalProxy.UpstreamConfig != nil { err = s.internalProxy.UpstreamConfig.Close() if err != nil { errs = append(errs, fmt.Errorf("could not stop internal resolvers properly: %w", err)) } } if s.localResolvers != nil && s.localResolvers.UpstreamConfig != nil { err = s.localResolvers.UpstreamConfig.Close() </s> remove return fmt.Errorf("couldn't stop forwarding DNS server: %w", err) </s> add return fmt.Errorf("stopping forwarding dns server: %w", err) } err = Context.clients.Close() if err != nil { return fmt.Errorf("closing clients container: %w", err) </s> remove err := Context.dnsServer.Stop() </s> add err = Context.dnsServer.Stop() </s> add // closeUpstreams closes the client-specific upstream config of c if any. func (c *Client) closeUpstreams() (err error) { if c.upstreamConfig != nil { err = c.upstreamConfig.Close() if err != nil { return fmt.Errorf("closing upstreams of client %q: %w", c.Name, err) } } return nil }
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/dnsforward/dnsforward.go
keep add keep keep keep keep keep
<mask> return fmt.Errorf("failed to choose upstream for %q: %w", upstreamAddr, err) <mask> } <mask> <mask> if err = healthCheck(u); err != nil { <mask> err = fmt.Errorf("upstream %q fails to exchange: %w", upstreamAddr, err) <mask> if domains != nil { <mask> return domainSpecificTestError{error: err} </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> remove return fmt.Errorf("couldn't stop forwarding DNS server: %w", err) </s> add return fmt.Errorf("stopping forwarding dns server: %w", err) } err = Context.clients.Close() if err != nil { return fmt.Errorf("closing clients container: %w", err) </s> add // closeUpstreams closes the client-specific upstream config of c if any. func (c *Client) closeUpstreams() (err error) { if c.upstreamConfig != nil { err = c.upstreamConfig.Close() if err != nil { return fmt.Errorf("closing upstreams of client %q: %w", c.Name, err) } } return nil } </s> remove err := Context.dnsServer.Stop() </s> add err = Context.dnsServer.Stop() </s> remove return fmt.Errorf("could not stop the DNS server properly: %w", err) </s> add errs = append(errs, fmt.Errorf("could not stop local resolvers properly: %w", err)) </s> remove err := s.dnsProxy.Stop() </s> add err = s.dnsProxy.Stop() if err != nil { errs = append(errs, fmt.Errorf("could not stop primary resolvers properly: %w", err)) } } if s.internalProxy != nil && s.internalProxy.UpstreamConfig != nil { err = s.internalProxy.UpstreamConfig.Close() if err != nil { errs = append(errs, fmt.Errorf("could not stop internal resolvers properly: %w", err)) } } if s.localResolvers != nil && s.localResolvers.UpstreamConfig != nil { err = s.localResolvers.UpstreamConfig.Close() </s> remove // update upstreams cache c.upstreamConfig = nil </s> add // Update upstreams cache. err = c.closeUpstreams() if err != nil { return err }
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/dnsforward/http.go
keep keep add keep keep keep keep
<mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> "github.com/AdguardTeam/golibs/stringutil" <mask> ) <mask> <mask> const clientsUpdatePeriod = 10 * time.Minute <mask> </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> add closeErr errors.Error = "closing failed" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/dnsproxy/upstream" </s> add // closeUpstreams closes the client-specific upstream config of c if any. func (c *Client) closeUpstreams() (err error) { if c.upstreamConfig != nil { err = c.upstreamConfig.Close() if err != nil { return fmt.Errorf("closing upstreams of client %q: %w", c.Name, err) } } return nil } </s> remove // update upstreams cache c.upstreamConfig = nil </s> add // Update upstreams cache. err = c.closeUpstreams() if err != nil { return err } </s> remove // update Name index </s> add // Update name index.
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/home/clients.go
keep add keep keep keep keep
<mask> } <mask> <mask> type clientSource uint <mask> <mask> // Client sources. The order determines the priority. <mask> const ( </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> add OnClose func() (err error) </s> add "golang.org/x/exp/maps" "golang.org/x/exp/slices" </s> add var _ upstream.Upstream = (*Upstream)(nil) </s> remove github.com/AdguardTeam/dnsproxy v0.45.3 </s> add github.com/AdguardTeam/dnsproxy v0.46.1 </s> remove // Exchange implements the upstream.Upstream interface for *Upstream. </s> add // Exchange implements the [upstream.Upstream] interface for *Upstream. </s> remove s.isRunning = false </s> add if len(errs) > 0 { return errors.List("stopping DNS server", errs...) } else { s.isRunning = false }
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/home/clients.go
keep add keep keep keep keep keep keep
<mask> } <mask> <mask> // update Name index <mask> delete(clients.list, name) <mask> <mask> // update ID index <mask> for _, id := range c.IDs { <mask> delete(clients.idIndex, id) </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> remove // update ID index </s> add // Update ID index. </s> remove // update Name index </s> add // Update name index. </s> remove // update upstreams cache c.upstreamConfig = nil </s> add // Update upstreams cache. err = c.closeUpstreams() if err != nil { return err } </s> remove // Address implements upstream.Upstream interface for *Upstream. </s> add // Address implements [upstream.Upstream] interface for *Upstream. </s> remove // Exchange implements the upstream.Upstream interface for *Upstream. </s> add // Exchange implements the [upstream.Upstream] interface for *Upstream. </s> add // Close implements [upstream.Upstream] interface for *Upstream. func (u *Upstream) Close() (err error) { return nil }
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/home/clients.go
keep keep keep keep replace keep keep keep keep keep
<mask> return fmt.Errorf("another client uses the same id (%q): %q", id, c2.Name) <mask> } <mask> } <mask> <mask> // update ID index <mask> for _, id := range prev.IDs { <mask> delete(clients.idIndex, id) <mask> } <mask> for _, id := range c.IDs { <mask> clients.idIndex[id] = prev </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> add if err := c.closeUpstreams(); err != nil { log.Error("client container: removing client %s: %s", name, err) } </s> remove // update Name index </s> add // Update name index. </s> remove // update upstreams cache c.upstreamConfig = nil </s> add // Update upstreams cache. err = c.closeUpstreams() if err != nil { return err } </s> add // closeUpstreams closes the client-specific upstream config of c if any. func (c *Client) closeUpstreams() (err error) { if c.upstreamConfig != nil { err = c.upstreamConfig.Close() if err != nil { return fmt.Errorf("closing upstreams of client %q: %w", c.Name, err) } } return nil } </s> remove // Exchange implements the upstream.Upstream interface for *Upstream. </s> add // Exchange implements the [upstream.Upstream] interface for *Upstream. </s> remove s.isRunning = false </s> add if len(errs) > 0 { return errors.List("stopping DNS server", errs...) } else { s.isRunning = false }
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/home/clients.go
keep keep keep keep replace keep keep keep keep keep
<mask> clients.idIndex[id] = prev <mask> } <mask> } <mask> <mask> // update Name index <mask> if prev.Name != c.Name { <mask> delete(clients.list, prev.Name) <mask> clients.list[c.Name] = prev <mask> } <mask> </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> remove // update upstreams cache c.upstreamConfig = nil </s> add // Update upstreams cache. err = c.closeUpstreams() if err != nil { return err } </s> remove // update ID index </s> add // Update ID index. </s> add if err := c.closeUpstreams(); err != nil { log.Error("client container: removing client %s: %s", name, err) } </s> remove err := s.dnsProxy.Stop() </s> add err = s.dnsProxy.Stop() if err != nil { errs = append(errs, fmt.Errorf("could not stop primary resolvers properly: %w", err)) } } if s.internalProxy != nil && s.internalProxy.UpstreamConfig != nil { err = s.internalProxy.UpstreamConfig.Close() if err != nil { errs = append(errs, fmt.Errorf("could not stop internal resolvers properly: %w", err)) } } if s.localResolvers != nil && s.localResolvers.UpstreamConfig != nil { err = s.localResolvers.UpstreamConfig.Close() </s> add // closeUpstreams closes the client-specific upstream config of c if any. func (c *Client) closeUpstreams() (err error) { if c.upstreamConfig != nil { err = c.upstreamConfig.Close() if err != nil { return fmt.Errorf("closing upstreams of client %q: %w", c.Name, err) } } return nil } </s> remove s.isRunning = false </s> add if len(errs) > 0 { return errors.List("stopping DNS server", errs...) } else { s.isRunning = false }
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/home/clients.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> delete(clients.list, prev.Name) <mask> clients.list[c.Name] = prev <mask> } <mask> <mask> // update upstreams cache <mask> c.upstreamConfig = nil <mask> <mask> *prev = *c <mask> <mask> return nil <mask> } </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> remove // update Name index </s> add // Update name index. </s> add // closeUpstreams closes the client-specific upstream config of c if any. func (c *Client) closeUpstreams() (err error) { if c.upstreamConfig != nil { err = c.upstreamConfig.Close() if err != nil { return fmt.Errorf("closing upstreams of client %q: %w", c.Name, err) } } return nil } </s> remove // update ID index </s> add // Update ID index. </s> add if err := c.closeUpstreams(); err != nil { log.Error("client container: removing client %s: %s", name, err) } </s> remove s.isRunning = false </s> add if len(errs) > 0 { return errors.List("stopping DNS server", errs...) } else { s.isRunning = false } </s> remove err := s.dnsProxy.Stop() </s> add err = s.dnsProxy.Stop() if err != nil { errs = append(errs, fmt.Errorf("could not stop primary resolvers properly: %w", err)) } } if s.internalProxy != nil && s.internalProxy.UpstreamConfig != nil { err = s.internalProxy.UpstreamConfig.Close() if err != nil { errs = append(errs, fmt.Errorf("could not stop internal resolvers properly: %w", err)) } } if s.localResolvers != nil && s.localResolvers.UpstreamConfig != nil { err = s.localResolvers.UpstreamConfig.Close()
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/home/clients.go
keep keep replace keep keep keep keep replace keep keep keep
<mask> } <mask> <mask> func stopDNSServer() error { <mask> if !isRunning() { <mask> return nil <mask> } <mask> <mask> err := Context.dnsServer.Stop() <mask> if err != nil { <mask> return fmt.Errorf("couldn't stop forwarding DNS server: %w", err) <mask> } </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> remove return fmt.Errorf("couldn't stop forwarding DNS server: %w", err) </s> add return fmt.Errorf("stopping forwarding dns server: %w", err) } err = Context.clients.Close() if err != nil { return fmt.Errorf("closing clients container: %w", err) </s> remove return fmt.Errorf("could not stop the DNS server properly: %w", err) </s> add errs = append(errs, fmt.Errorf("could not stop local resolvers properly: %w", err)) </s> remove err := s.dnsProxy.Stop() </s> add err = s.dnsProxy.Stop() if err != nil { errs = append(errs, fmt.Errorf("could not stop primary resolvers properly: %w", err)) } } if s.internalProxy != nil && s.internalProxy.UpstreamConfig != nil { err = s.internalProxy.UpstreamConfig.Close() if err != nil { errs = append(errs, fmt.Errorf("could not stop internal resolvers properly: %w", err)) } } if s.localResolvers != nil && s.localResolvers.UpstreamConfig != nil { err = s.localResolvers.UpstreamConfig.Close() </s> remove // stopLocked stops the DNS server without locking. For internal use only. func (s *Server) stopLocked() error { </s> add // stopLocked stops the DNS server without locking. For internal use only. func (s *Server) stopLocked() (err error) { var errs []error </s> remove s.isRunning = false </s> add if len(errs) > 0 { return errors.List("stopping DNS server", errs...) } else { s.isRunning = false }
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> err := Context.dnsServer.Stop() <mask> if err != nil { <mask> return fmt.Errorf("couldn't stop forwarding DNS server: %w", err) <mask> } <mask> <mask> closeDNSServer() <mask> return nil <mask> } </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> remove err := Context.dnsServer.Stop() </s> add err = Context.dnsServer.Stop() </s> remove return fmt.Errorf("could not stop the DNS server properly: %w", err) </s> add errs = append(errs, fmt.Errorf("could not stop local resolvers properly: %w", err)) </s> remove err := s.dnsProxy.Stop() </s> add err = s.dnsProxy.Stop() if err != nil { errs = append(errs, fmt.Errorf("could not stop primary resolvers properly: %w", err)) } } if s.internalProxy != nil && s.internalProxy.UpstreamConfig != nil { err = s.internalProxy.UpstreamConfig.Close() if err != nil { errs = append(errs, fmt.Errorf("could not stop internal resolvers properly: %w", err)) } } if s.localResolvers != nil && s.localResolvers.UpstreamConfig != nil { err = s.localResolvers.UpstreamConfig.Close() </s> remove s.isRunning = false </s> add if len(errs) > 0 { return errors.List("stopping DNS server", errs...) } else { s.isRunning = false } </s> remove func stopDNSServer() error { </s> add func stopDNSServer() (err error) { </s> remove // stopLocked stops the DNS server without locking. For internal use only. func (s *Server) stopLocked() error { </s> add // stopLocked stops the DNS server without locking. For internal use only. func (s *Server) stopLocked() (err error) { var errs []error
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/home/dns.go
keep add keep keep keep keep keep
<mask> "github.com/AdguardTeam/AdGuardHome/internal/next/dnssvc" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/miekg/dns" <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) <mask> </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> add "github.com/AdguardTeam/dnsproxy/upstream" </s> add "golang.org/x/exp/maps" "golang.org/x/exp/slices" </s> add closeErr errors.Error = "closing failed" </s> remove require.NoError(t, err) </s> add require.ErrorIs(t, err, closeErr) </s> add // Close implements [upstream.Upstream] interface for *Upstream. func (u *Upstream) Close() (err error) { return nil } </s> remove // Address implements upstream.Upstream interface for *Upstream. </s> add // Address implements [upstream.Upstream] interface for *Upstream.
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/next/dnssvc/dnssvc_test.go
keep add keep keep keep keep keep
<mask> bootstrapAddr = "bootstrap.example" <mask> upstreamAddr = "upstream.example" <mask> ) <mask> <mask> ups := &aghtest.UpstreamMock{ <mask> OnAddress: func() (addr string) { <mask> return upstreamAddr </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> add OnClose func() (err error) </s> add OnClose: func() (err error) { return closeErr }, </s> add defer func() { err = errors.WithDeferred(err, u.Close()) }() </s> add "golang.org/x/exp/maps" "golang.org/x/exp/slices" </s> remove // update upstreams cache c.upstreamConfig = nil </s> add // Update upstreams cache. err = c.closeUpstreams() if err != nil { return err } </s> remove err := Context.dnsServer.Stop() </s> add err = Context.dnsServer.Stop()
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/next/dnssvc/dnssvc_test.go
keep keep keep add keep keep keep keep
<mask> resp = (&dns.Msg{}).SetReply(req) <mask> <mask> return resp, nil <mask> }, <mask> } <mask> <mask> c := &dnssvc.Config{ <mask> Addresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:0")}, </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> remove // Exchange implements the upstream.Upstream interface for *Upstream. </s> add // Exchange implements the [upstream.Upstream] interface for *Upstream. </s> add // closeUpstreams closes the client-specific upstream config of c if any. func (c *Client) closeUpstreams() (err error) { if c.upstreamConfig != nil { err = c.upstreamConfig.Close() if err != nil { return fmt.Errorf("closing upstreams of client %q: %w", c.Name, err) } } return nil } </s> remove // Address implements upstream.Upstream interface for *Upstream. </s> add // Address implements [upstream.Upstream] interface for *Upstream. </s> remove // update upstreams cache c.upstreamConfig = nil </s> add // Update upstreams cache. err = c.closeUpstreams() if err != nil { return err } </s> remove return fmt.Errorf("couldn't stop forwarding DNS server: %w", err) </s> add return fmt.Errorf("stopping forwarding dns server: %w", err) } err = Context.clients.Close() if err != nil { return fmt.Errorf("closing clients container: %w", err) </s> remove err := Context.dnsServer.Stop() </s> add err = Context.dnsServer.Stop()
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/next/dnssvc/dnssvc_test.go
keep keep keep keep replace keep
<mask> ctx, cancel := context.WithTimeout(context.Background(), testTimeout) <mask> defer cancel() <mask> <mask> err = svc.Shutdown(ctx) <mask> require.NoError(t, err) <mask> } </s> Pull request: 5044 Close upstreams Merge in DNS/adguard-home from 5044-close-upstreams to master Closes #5044. Squashed commit of the following: commit e121380ecb32bd2664d47f0968c68509156404c1 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 15:54:17 2022 +0300 all: upd proxy again commit ce7fa539a7430a1a197fd45e7988697010c684db Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:30:46 2022 +0300 home: imp docs, names commit 851c5b8128149941cc469e6192ec9b4b1f92b0b5 Merge: b9ee5d63 d2a09e49 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:21:44 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit b9ee5d6348e696ff0b44dabee601469c545c8bd9 Author: Eugene Burkov <[email protected]> Date: Wed Oct 19 14:20:15 2022 +0300 all: close upstreams more commit eaca476319dc64e7986e26e67110005938cf1278 Merge: f924bc7a 8dba4ecd Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:33:53 2022 +0300 Merge branch 'master' into 5044-close-upstreams commit f924bc7a836001f8bb7463de2b5ddaf1be1a53c1 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 18:23:54 2022 +0300 all: imp code, docs commit 011fde16aa912fc78e3d6f60375cee73a0d88709 Author: Eugene Burkov <[email protected]> Date: Tue Oct 18 17:26:40 2022 +0300 all: upd dnsproxy </s> add defer func() { err = errors.WithDeferred(err, u.Close()) }() </s> remove return fmt.Errorf("couldn't stop forwarding DNS server: %w", err) </s> add return fmt.Errorf("stopping forwarding dns server: %w", err) } err = Context.clients.Close() if err != nil { return fmt.Errorf("closing clients container: %w", err) </s> remove err := Context.dnsServer.Stop() </s> add err = Context.dnsServer.Stop() </s> remove return fmt.Errorf("could not stop the DNS server properly: %w", err) </s> add errs = append(errs, fmt.Errorf("could not stop local resolvers properly: %w", err)) </s> remove err := s.dnsProxy.Stop() </s> add err = s.dnsProxy.Stop() if err != nil { errs = append(errs, fmt.Errorf("could not stop primary resolvers properly: %w", err)) } } if s.internalProxy != nil && s.internalProxy.UpstreamConfig != nil { err = s.internalProxy.UpstreamConfig.Close() if err != nil { errs = append(errs, fmt.Errorf("could not stop internal resolvers properly: %w", err)) } } if s.localResolvers != nil && s.localResolvers.UpstreamConfig != nil { err = s.localResolvers.UpstreamConfig.Close() </s> remove // update upstreams cache c.upstreamConfig = nil </s> add // Update upstreams cache. err = c.closeUpstreams() if err != nil { return err }
https://github.com/AdguardTeam/AdGuardHome/commit/2de42284a5f8cf8f75f77059ba13f09b26a5ee6d
internal/next/dnssvc/dnssvc_test.go
keep keep keep keep replace keep keep keep keep replace keep keep keep keep
<mask> github.com/gobuffalo/packr v1.30.1 <mask> github.com/gobuffalo/packr/v2 v2.8.1 // indirect <mask> github.com/google/go-cmp v0.5.5 // indirect <mask> github.com/google/renameio v1.0.1-0.20210406141108-81588dbe0453 <mask> github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714 <mask> github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2 <mask> github.com/kardianos/service v1.2.0 <mask> github.com/karrick/godirwalk v1.16.1 // indirect <mask> github.com/lucas-clemente/quic-go v0.20.1 <mask> github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 <mask> github.com/mdlayher/netlink v1.4.0 <mask> github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065 <mask> github.com/miekg/dns v1.1.40 <mask> github.com/rogpeppe/go-internal v1.7.0 // indirect </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> remove github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065 </s> add </s> remove github.com/u-root/u-root v7.0.0+incompatible </s> add </s> remove github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2 h1:NpTIlXznCStsY88jU+Gh1Dy5dt/jYV4z4uU8h2TUOt4= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI= </s> add </s> remove github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= </s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
go.mod
keep keep keep keep replace keep keep keep keep keep
<mask> github.com/karrick/godirwalk v1.16.1 // indirect <mask> github.com/lucas-clemente/quic-go v0.20.1 <mask> github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 <mask> github.com/mdlayher/netlink v1.4.0 <mask> github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065 <mask> github.com/miekg/dns v1.1.40 <mask> github.com/rogpeppe/go-internal v1.7.0 // indirect <mask> github.com/satori/go.uuid v1.2.0 <mask> github.com/sirupsen/logrus v1.8.1 // indirect <mask> github.com/spf13/cobra v1.1.3 // indirect </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> remove github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 </s> add </s> remove github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714 </s> add </s> remove github.com/u-root/u-root v7.0.0+incompatible </s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= </s> add </s> remove github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2 h1:NpTIlXznCStsY88jU+Gh1Dy5dt/jYV4z4uU8h2TUOt4= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI= </s> add </s> add "github.com/insomniacslk/dhcp/dhcpv4/nclient4"
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
go.mod
keep keep keep keep replace keep keep keep keep keep
<mask> github.com/sirupsen/logrus v1.8.1 // indirect <mask> github.com/spf13/cobra v1.1.3 // indirect <mask> github.com/stretchr/testify v1.7.0 <mask> github.com/ti-mo/netfilter v0.4.0 <mask> github.com/u-root/u-root v7.0.0+incompatible <mask> go.etcd.io/bbolt v1.3.5 <mask> golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 <mask> golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 <mask> golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect <mask> golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> remove github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065 </s> add </s> remove github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 </s> add </s> remove github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714 </s> add </s> add "github.com/insomniacslk/dhcp/dhcpv4/nclient4" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/dhcpd/nclient4" </s> add </s> remove google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
go.mod
keep keep add keep keep keep keep keep keep
<mask> dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= <mask> dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= <mask> git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= <mask> github.com/AdguardTeam/dnsproxy v0.37.1 h1:vULyF1+xSI7vV99m8GD2hmOuCQrpu87awyeSe5qtFbA= <mask> github.com/AdguardTeam/dnsproxy v0.37.1/go.mod h1:xkJWEuTr550gPDmB9azsciKZzSXjf9wMn+Ji54PQ4gE= <mask> github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.4.4/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.4.5 h1:RRA9ZsmbJEN4OllAx0BcfvSbRBxxpWluJijBYmtp13U= </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> remove github.com/AdguardTeam/golibs v0.4.4 h1:cM9UySQiYFW79zo5XRwnaIWVzfW4eNXmZktMrWbthpw= </s> add </s> add "github.com/insomniacslk/dhcp/dhcpv4/nclient4" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/dhcpd/nclient4" </s> add </s> remove google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= </s> add </s> remove google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= </s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
go.sum
keep keep keep keep replace keep keep keep keep keep
<mask> github.com/AdguardTeam/dnsproxy v0.37.1 h1:vULyF1+xSI7vV99m8GD2hmOuCQrpu87awyeSe5qtFbA= <mask> github.com/AdguardTeam/dnsproxy v0.37.1/go.mod h1:xkJWEuTr550gPDmB9azsciKZzSXjf9wMn+Ji54PQ4gE= <mask> github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.4.4 h1:cM9UySQiYFW79zo5XRwnaIWVzfW4eNXmZktMrWbthpw= <mask> github.com/AdguardTeam/golibs v0.4.4/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.4.5 h1:RRA9ZsmbJEN4OllAx0BcfvSbRBxxpWluJijBYmtp13U= <mask> github.com/AdguardTeam/golibs v0.4.5/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU= <mask> github.com/AdguardTeam/urlfilter v0.14.4 h1:lrS7lrfxVCFh4TFB6nwPp5UE4n1XNvv3zUetduD9mZw= </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> add github.com/AdguardTeam/dhcp v0.0.0-20210420175708-50b0efd52063 h1:RBsQppxEJEqHApY6WDBkM2H0UG5wt57RcT0El2WGdp8= github.com/AdguardTeam/dhcp v0.0.0-20210420175708-50b0efd52063/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI= </s> remove github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= </s> add </s> add "github.com/insomniacslk/dhcp/dhcpv4/nclient4" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/dhcpd/nclient4" </s> add </s> remove google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= </s> add </s> remove google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
go.sum
keep keep keep keep replace keep keep keep keep keep
<mask> github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= <mask> github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= <mask> github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= <mask> github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= <mask> github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= <mask> github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= <mask> github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= <mask> github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= <mask> github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= <mask> github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> remove github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2 h1:NpTIlXznCStsY88jU+Gh1Dy5dt/jYV4z4uU8h2TUOt4= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI= </s> add </s> remove github.com/AdguardTeam/golibs v0.4.4 h1:cM9UySQiYFW79zo5XRwnaIWVzfW4eNXmZktMrWbthpw= </s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= </s> add </s> add "github.com/insomniacslk/dhcp/dhcpv4/nclient4" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/dhcpd/nclient4" </s> add </s> remove google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
go.sum
keep keep keep keep replace keep keep keep keep keep
<mask> github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw= <mask> github.com/gobuffalo/packr/v2 v2.8.1 h1:tkQpju6i3EtMXJ9uoF5GT6kB+LMTimDWD8Xvbz6zDVA= <mask> github.com/gobuffalo/packr/v2 v2.8.1/go.mod h1:c/PLlOuTU+p3SybaJATW3H6lX/iK7xEz5OeMf+NnJpg= <mask> github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= <mask> github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= <mask> github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= <mask> github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= <mask> github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= <mask> github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= <mask> github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> remove github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= </s> add </s> remove github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714 </s> add </s> add "github.com/insomniacslk/dhcp/dhcpv4/nclient4" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/dhcpd/nclient4" </s> add </s> remove google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= </s> add </s> remove google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
go.sum
keep keep keep keep replace keep keep keep keep keep
<mask> github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= <mask> github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= <mask> github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= <mask> github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= <mask> github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= <mask> github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= <mask> github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= <mask> github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= <mask> github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= <mask> github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> remove github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= </s> add </s> add "github.com/insomniacslk/dhcp/dhcpv4/nclient4" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/dhcpd/nclient4" </s> add </s> remove google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= </s> add </s> remove google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= </s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
go.sum
keep keep keep replace replace replace keep replace keep keep
<mask> github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714/go.mod h1:2Goc3h8EklBH5mspfHFxBnEoURQCGzQQH1ga9Myjvis= <mask> github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= <mask> github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= <mask> github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= <mask> github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2 h1:NpTIlXznCStsY88jU+Gh1Dy5dt/jYV4z4uU8h2TUOt4= <mask> github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI= <mask> github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= <mask> github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= <mask> github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= <mask> github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> remove github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714 </s> add </s> remove github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 </s> add </s> remove github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= </s> add </s> add github.com/AdguardTeam/dhcp v0.0.0-20210420175708-50b0efd52063 h1:RBsQppxEJEqHApY6WDBkM2H0UG5wt57RcT0El2WGdp8= github.com/AdguardTeam/dhcp v0.0.0-20210420175708-50b0efd52063/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI= </s> remove github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065 </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
go.sum
keep keep keep keep replace keep keep keep keep keep
<mask> google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= <mask> google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= <mask> google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= <mask> google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= <mask> google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= <mask> google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= <mask> google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= <mask> google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= <mask> google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= <mask> google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> remove google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= </s> add </s> add "github.com/insomniacslk/dhcp/dhcpv4/nclient4" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/dhcpd/nclient4" </s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= </s> add </s> remove github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2 h1:NpTIlXznCStsY88jU+Gh1Dy5dt/jYV4z4uU8h2TUOt4= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI= </s> add </s> remove github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
go.sum
keep keep keep keep replace keep keep keep keep keep
<mask> google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= <mask> google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= <mask> google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= <mask> google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= <mask> google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= <mask> google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= <mask> google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= <mask> google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= <mask> google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= <mask> google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> remove google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= </s> add </s> add "github.com/insomniacslk/dhcp/dhcpv4/nclient4" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/dhcpd/nclient4" </s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= </s> add </s> remove github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2 h1:NpTIlXznCStsY88jU+Gh1Dy5dt/jYV4z4uU8h2TUOt4= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI= </s> add </s> remove github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
go.sum
keep keep keep keep replace keep keep keep keep keep
<mask> "os" <mask> "runtime" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd/nclient4" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/insomniacslk/dhcp/dhcpv4" <mask> "github.com/insomniacslk/dhcp/dhcpv6" <mask> "github.com/insomniacslk/dhcp/dhcpv6/nclient6" <mask> "github.com/insomniacslk/dhcp/iana" </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> add "github.com/insomniacslk/dhcp/dhcpv4/nclient4" </s> remove google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= </s> add </s> remove google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= </s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= </s> add </s> remove github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2 h1:NpTIlXznCStsY88jU+Gh1Dy5dt/jYV4z4uU8h2TUOt4= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI= </s> add </s> remove github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
internal/dhcpd/checkother.go
keep keep keep add keep keep keep keep
<mask> "time" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/insomniacslk/dhcp/dhcpv4" <mask> "github.com/insomniacslk/dhcp/dhcpv6" <mask> "github.com/insomniacslk/dhcp/dhcpv6/nclient6" <mask> "github.com/insomniacslk/dhcp/iana" <mask> ) </s> Pull request: 2606 substitute nclient4 with fork Merge in DNS/adguard-home from 2606-rm-nclient4 to master Closes #2606. Squashed commit of the following: commit a9abc3ac27b19ef0ab6c4dea8610d97034b24ec2 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:22:56 2021 +0300 nclient4: rm commit abcd0042a7f0d1fbf7ebb398a06414bbc7fc2528 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 13:19:11 2021 +0300 all: clear changes commit d1bc3b83f00be07bf9bb97cfe6ef773e07ae8710 Merge: 1b1ab0b9 c2667558 Author: Eugene Burkov <[email protected]> Date: Wed Apr 21 12:58:48 2021 +0300 Merge branch 'master' into 2606-rm-nclient4 commit 1b1ab0b9796552854ecffefe8e79ca24b472fed0 Author: Eugene Burkov <[email protected]> Date: Mon Apr 19 18:53:04 2021 +0300 dhcpd: subst nclient4 with fork </s> remove "github.com/AdguardTeam/AdGuardHome/internal/dhcpd/nclient4" </s> add </s> remove google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= </s> add </s> remove google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= </s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= </s> add </s> remove github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2 h1:NpTIlXznCStsY88jU+Gh1Dy5dt/jYV4z4uU8h2TUOt4= github.com/insomniacslk/dhcp v0.0.0-20210310193751-cfd4d47082c2/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI= </s> add </s> remove github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2e4e1973d990e2deec5a6b91c4ddc31f49136a6a
internal/dhcpd/checkother.go
keep keep keep replace keep keep replace replace replace replace replace keep keep keep keep
<mask> } <mask> <mask> // Create - create object <mask> func Create(config ServerConfig) *Server { <mask> s := &Server{} <mask> <mask> s.conf.Enabled = config.Enabled <mask> s.conf.InterfaceName = config.InterfaceName <mask> s.conf.HTTPRegister = config.HTTPRegister <mask> s.conf.ConfigModified = config.ConfigModified <mask> s.conf.DBFilePath = filepath.Join(config.WorkDir, dbFilename) <mask> <mask> if !webHandlersRegistered && s.conf.HTTPRegister != nil { <mask> if runtime.GOOS == "windows" { <mask> // Our DHCP server doesn't work on Windows yet, so </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> add s.conf.Conf4 = conf.Conf4 s.conf.Conf6 = conf.Conf6 </s> remove if js.Exists("interface_name") { s.conf.InterfaceName = newconfig.InterfaceName </s> add if conf.InterfaceName != "" { s.conf.InterfaceName = conf.InterfaceName </s> remove if js.Exists("enabled") { s.conf.Enabled = newconfig.Enabled </s> add if conf.Enabled != nbNull { s.conf.Enabled = conf.Enabled == nbTrue </s> remove if js.Exists("v6") { v6conf := v6JSONToServerConf(newconfig.V6) v6conf.Enabled = newconfig.Enabled if len(v6conf.RangeStart) == 0 { v6conf.Enabled = false </s> add if conf.V6 != nil { v6Conf := v6JSONToServerConf(conf.V6) v6Conf.Enabled = conf.Enabled == nbTrue if len(v6Conf.RangeStart) == 0 { v6Conf.Enabled = false </s> remove v6Enabled = v6conf.Enabled v6conf.InterfaceName = newconfig.InterfaceName v6conf.notify = s.onNotify </s> add // Don't overwrite the RA/SLAAC settings from the config file. // // TODO(a.garipov): Perhaps include them into the request to // allow changing them from the HTTP API? v6Conf.RASLAACOnly = s.conf.Conf6.RASLAACOnly v6Conf.RAAllowSLAAC = s.conf.Conf6.RAAllowSLAAC v6Enabled = v6Conf.Enabled v6Conf.InterfaceName = conf.InterfaceName v6Conf.notify = s.onNotify
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcpd.go
keep keep keep keep replace keep keep keep keep keep
<mask> webHandlersRegistered = true <mask> } <mask> <mask> var err4, err6 error <mask> v4conf := config.Conf4 <mask> v4conf.Enabled = s.conf.Enabled <mask> if len(v4conf.RangeStart) == 0 { <mask> v4conf.Enabled = false <mask> } <mask> v4conf.InterfaceName = s.conf.InterfaceName </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove if js.Exists("v4") { v4conf := v4JSONToServerConf(newconfig.V4) v4conf.Enabled = newconfig.Enabled if len(v4conf.RangeStart) == 0 { v4conf.Enabled = false </s> add if conf.V4 != nil { v4Conf := v4JSONToServerConf(conf.V4) v4Conf.Enabled = conf.Enabled == nbTrue if len(v4Conf.RangeStart) == 0 { v4Conf.Enabled = false </s> remove v4Enabled = v4conf.Enabled v4conf.InterfaceName = newconfig.InterfaceName </s> add v4Enabled = v4Conf.Enabled v4Conf.InterfaceName = conf.InterfaceName </s> remove v6conf := config.Conf6 </s> add v6conf := conf.Conf6 </s> remove if js.Exists("v6") { v6conf := v6JSONToServerConf(newconfig.V6) v6conf.Enabled = newconfig.Enabled if len(v6conf.RangeStart) == 0 { v6conf.Enabled = false </s> add if conf.V6 != nil { v6Conf := v6JSONToServerConf(conf.V6) v6Conf.Enabled = conf.Enabled == nbTrue if len(v6Conf.RangeStart) == 0 { v6Conf.Enabled = false </s> remove if js.Exists("enabled") { s.conf.Enabled = newconfig.Enabled </s> add if conf.Enabled != nbNull { s.conf.Enabled = conf.Enabled == nbTrue </s> remove if js.Exists("interface_name") { s.conf.InterfaceName = newconfig.InterfaceName </s> add if conf.InterfaceName != "" { s.conf.InterfaceName = conf.InterfaceName
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcpd.go
keep keep keep keep replace keep keep keep keep keep
<mask> v4conf.InterfaceName = s.conf.InterfaceName <mask> v4conf.notify = s.onNotify <mask> s.srv4, err4 = v4Create(v4conf) <mask> <mask> v6conf := config.Conf6 <mask> v6conf.Enabled = s.conf.Enabled <mask> if len(v6conf.RangeStart) == 0 { <mask> v6conf.Enabled = false <mask> } <mask> v6conf.InterfaceName = s.conf.InterfaceName </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove if js.Exists("v6") { v6conf := v6JSONToServerConf(newconfig.V6) v6conf.Enabled = newconfig.Enabled if len(v6conf.RangeStart) == 0 { v6conf.Enabled = false </s> add if conf.V6 != nil { v6Conf := v6JSONToServerConf(conf.V6) v6Conf.Enabled = conf.Enabled == nbTrue if len(v6Conf.RangeStart) == 0 { v6Conf.Enabled = false </s> remove v6Enabled = v6conf.Enabled v6conf.InterfaceName = newconfig.InterfaceName v6conf.notify = s.onNotify </s> add // Don't overwrite the RA/SLAAC settings from the config file. // // TODO(a.garipov): Perhaps include them into the request to // allow changing them from the HTTP API? v6Conf.RASLAACOnly = s.conf.Conf6.RASLAACOnly v6Conf.RAAllowSLAAC = s.conf.Conf6.RAAllowSLAAC v6Enabled = v6Conf.Enabled v6Conf.InterfaceName = conf.InterfaceName v6Conf.notify = s.onNotify </s> remove v4conf := config.Conf4 </s> add v4conf := conf.Conf4 </s> remove v4Enabled = v4conf.Enabled v4conf.InterfaceName = newconfig.InterfaceName </s> add v4Enabled = v4Conf.Enabled v4Conf.InterfaceName = conf.InterfaceName </s> remove s6, err = v6Create(v6conf) </s> add s6, err = v6Create(v6Conf) </s> remove if js.Exists("v4") { v4conf := v4JSONToServerConf(newconfig.V4) v4conf.Enabled = newconfig.Enabled if len(v4conf.RangeStart) == 0 { v4conf.Enabled = false </s> add if conf.V4 != nil { v4Conf := v4JSONToServerConf(conf.V4) v4Conf.Enabled = conf.Enabled == nbTrue if len(v4Conf.RangeStart) == 0 { v4Conf.Enabled = false
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcpd.go
keep add keep keep keep keep keep
<mask> } <mask> <mask> if s.conf.Enabled && !v4conf.Enabled && !v6conf.Enabled { <mask> log.Error("Can't enable DHCP server because neither DHCPv4 nor DHCPv6 servers are configured") <mask> return nil <mask> } <mask> </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove if newconfig.Enabled && !v4Enabled && !v6Enabled { httpError(r, w, http.StatusBadRequest, "dhcpv4 or dhcpv6 configuration must be complete") </s> add if conf.Enabled == nbTrue && !v4Enabled && !v6Enabled { httpError(r, w, http.StatusBadRequest, "dhcpv4 or dhcpv6 configuration must be complete") </s> remove if s.conf.RaSlaacOnly { </s> add if s.conf.RASLAACOnly { </s> remove s.conf.Enabled = config.Enabled s.conf.InterfaceName = config.InterfaceName s.conf.HTTPRegister = config.HTTPRegister s.conf.ConfigModified = config.ConfigModified s.conf.DBFilePath = filepath.Join(config.WorkDir, dbFilename) </s> add s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> remove js, err := jsonutil.DecodeObject(&newconfig, r.Body) </s> add err := json.NewDecoder(r.Body).Decode(&conf) </s> remove if js.Exists("interface_name") { s.conf.InterfaceName = newconfig.InterfaceName </s> add if conf.InterfaceName != "" { s.conf.InterfaceName = conf.InterfaceName </s> remove if js.Exists("enabled") { s.conf.Enabled = newconfig.Enabled </s> add if conf.Enabled != nbNull { s.conf.Enabled = conf.Enabled == nbTrue
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcpd.go
keep keep keep keep replace keep keep keep keep keep
<mask> "strings" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/sysutil" <mask> "github.com/AdguardTeam/AdGuardHome/internal/util" <mask> "github.com/AdguardTeam/golibs/jsonutil" <mask> "github.com/AdguardTeam/golibs/log" <mask> ) <mask> <mask> func httpError(r *http.Request, w http.ResponseWriter, code int, format string, args ...interface{}) { <mask> text := fmt.Sprintf(format, args...) </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> add type dhcpServerConfigJSON struct { V4 *v4ServerConfJSON `json:"v4"` V6 *v6ServerConfJSON `json:"v6"` InterfaceName string `json:"interface_name"` Enabled nullBool `json:"enabled"` } </s> remove type dhcpServerConfigJSON struct { Enabled bool `json:"enabled"` InterfaceName string `json:"interface_name"` V4 v4ServerConfJSON `json:"v4"` V6 v6ServerConfJSON `json:"v6"` } </s> add </s> remove newconfig := dhcpServerConfigJSON{} newconfig.Enabled = s.conf.Enabled newconfig.InterfaceName = s.conf.InterfaceName </s> add conf := dhcpServerConfigJSON{} conf.Enabled = boolToNullBool(s.conf.Enabled) conf.InterfaceName = s.conf.InterfaceName </s> remove code, err = s.enableDHCP(newconfig.InterfaceName) </s> add code, err = s.enableDHCP(conf.InterfaceName) </s> remove func Create(config ServerConfig) *Server { </s> add func Create(conf ServerConfig) *Server { </s> remove func v6JSONToServerConf(j v6ServerConfJSON) V6ServerConf { </s> add func v6JSONToServerConf(j *v6ServerConfJSON) V6ServerConf { if j == nil { return V6ServerConf{} }
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep keep replace keep keep keep keep keep
<mask> RangeEnd net.IP `json:"range_end"` <mask> LeaseDuration uint32 `json:"lease_duration"` <mask> } <mask> <mask> func v4JSONToServerConf(j v4ServerConfJSON) V4ServerConf { <mask> return V4ServerConf{ <mask> GatewayIP: j.GatewayIP, <mask> SubnetMask: j.SubnetMask, <mask> RangeStart: j.RangeStart, <mask> RangeEnd: j.RangeEnd, </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove func v6JSONToServerConf(j v6ServerConfJSON) V6ServerConf { </s> add func v6JSONToServerConf(j *v6ServerConfJSON) V6ServerConf { if j == nil { return V6ServerConf{} } </s> remove RaSlaacOnly bool `yaml:"ra_slaac_only" json:"-"` // send ICMPv6.RA packets without MO flags RaAllowSlaac bool `yaml:"ra_allow_slaac" json:"-"` // send ICMPv6.RA packets with MO flags </s> add RASLAACOnly bool `yaml:"ra_slaac_only" json:"-"` // send ICMPv6.RA packets without MO flags RAAllowSLAAC bool `yaml:"ra_allow_slaac" json:"-"` // send ICMPv6.RA packets with MO flags </s> remove type dhcpServerConfigJSON struct { Enabled bool `json:"enabled"` InterfaceName string `json:"interface_name"` V4 v4ServerConfJSON `json:"v4"` V6 v6ServerConfJSON `json:"v6"` } </s> add </s> remove if !(ra.raAllowSlaac || ra.raSlaacOnly) { </s> add if !(ra.raAllowSLAAC || ra.raSLAACOnly) { </s> remove func Create(config ServerConfig) *Server { </s> add func Create(conf ServerConfig) *Server { </s> remove raAllowSlaac bool // send RA packets without MO flags raSlaacOnly bool // send RA packets with MO flags </s> add raAllowSLAAC bool // send RA packets without MO flags raSLAACOnly bool // send RA packets with MO flags
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep keep replace keep keep keep keep keep
<mask> RangeStart net.IP `json:"range_start"` <mask> LeaseDuration uint32 `json:"lease_duration"` <mask> } <mask> <mask> func v6JSONToServerConf(j v6ServerConfJSON) V6ServerConf { <mask> return V6ServerConf{ <mask> RangeStart: j.RangeStart, <mask> LeaseDuration: j.LeaseDuration, <mask> } <mask> } </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove func v4JSONToServerConf(j v4ServerConfJSON) V4ServerConf { </s> add func v4JSONToServerConf(j *v4ServerConfJSON) V4ServerConf { if j == nil { return V4ServerConf{} } </s> remove RaSlaacOnly bool `yaml:"ra_slaac_only" json:"-"` // send ICMPv6.RA packets without MO flags RaAllowSlaac bool `yaml:"ra_allow_slaac" json:"-"` // send ICMPv6.RA packets with MO flags </s> add RASLAACOnly bool `yaml:"ra_slaac_only" json:"-"` // send ICMPv6.RA packets without MO flags RAAllowSLAAC bool `yaml:"ra_allow_slaac" json:"-"` // send ICMPv6.RA packets with MO flags </s> remove type dhcpServerConfigJSON struct { Enabled bool `json:"enabled"` InterfaceName string `json:"interface_name"` V4 v4ServerConfJSON `json:"v4"` V6 v6ServerConfJSON `json:"v6"` } </s> add </s> remove if errors.Is(err, os.ErrNotExist) { continue } </s> add </s> remove if newconfig.Enabled && !v4Enabled && !v6Enabled { httpError(r, w, http.StatusBadRequest, "dhcpv4 or dhcpv6 configuration must be complete") </s> add if conf.Enabled == nbTrue && !v4Enabled && !v6Enabled { httpError(r, w, http.StatusBadRequest, "dhcpv4 or dhcpv6 configuration must be complete") </s> add if errors.Is(err, os.ErrNotExist) { err = nil continue }
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
<mask> return <mask> } <mask> } <mask> <mask> type dhcpServerConfigJSON struct { <mask> Enabled bool `json:"enabled"` <mask> InterfaceName string `json:"interface_name"` <mask> V4 v4ServerConfJSON `json:"v4"` <mask> V6 v6ServerConfJSON `json:"v6"` <mask> } <mask> <mask> func (s *Server) enableDHCP(ifaceName string) (code int, err error) { <mask> var hasStaticIP bool <mask> hasStaticIP, err = sysutil.IfaceHasStaticIP(ifaceName) <mask> if err != nil { <mask> return http.StatusInternalServerError, fmt.Errorf("checking static ip: %w", err) </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> add type dhcpServerConfigJSON struct { V4 *v4ServerConfJSON `json:"v4"` V6 *v6ServerConfJSON `json:"v6"` InterfaceName string `json:"interface_name"` Enabled nullBool `json:"enabled"` } </s> remove newconfig := dhcpServerConfigJSON{} newconfig.Enabled = s.conf.Enabled newconfig.InterfaceName = s.conf.InterfaceName </s> add conf := dhcpServerConfigJSON{} conf.Enabled = boolToNullBool(s.conf.Enabled) conf.InterfaceName = s.conf.InterfaceName </s> add if errors.Is(err, os.ErrNotExist) { err = nil continue } </s> remove code, err = s.enableDHCP(newconfig.InterfaceName) </s> add code, err = s.enableDHCP(conf.InterfaceName) </s> remove fileReadCloser, err := aghio.LimitReadCloser(f, maxConfigFileSize) </s> add var fileReadCloser io.ReadCloser fileReadCloser, err = aghio.LimitReadCloser(f, maxConfigFileSize) </s> remove raAllowSlaac bool // send RA packets without MO flags raSlaacOnly bool // send RA packets with MO flags </s> add raAllowSLAAC bool // send RA packets without MO flags raSLAACOnly bool // send RA packets with MO flags
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep add keep keep keep keep keep keep
<mask> } <mask> <mask> func (s *Server) handleDHCPSetConfig(w http.ResponseWriter, r *http.Request) { <mask> conf := dhcpServerConfigJSON{} <mask> conf.Enabled = boolToNullBool(s.conf.Enabled) <mask> conf.InterfaceName = s.conf.InterfaceName <mask> <mask> err := json.NewDecoder(r.Body).Decode(&conf) </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove newconfig := dhcpServerConfigJSON{} newconfig.Enabled = s.conf.Enabled newconfig.InterfaceName = s.conf.InterfaceName </s> add conf := dhcpServerConfigJSON{} conf.Enabled = boolToNullBool(s.conf.Enabled) conf.InterfaceName = s.conf.InterfaceName </s> remove js, err := jsonutil.DecodeObject(&newconfig, r.Body) </s> add err := json.NewDecoder(r.Body).Decode(&conf) </s> remove type dhcpServerConfigJSON struct { Enabled bool `json:"enabled"` InterfaceName string `json:"interface_name"` V4 v4ServerConfJSON `json:"v4"` V6 v6ServerConfJSON `json:"v6"` } </s> add </s> remove if js.Exists("interface_name") { s.conf.InterfaceName = newconfig.InterfaceName </s> add if conf.InterfaceName != "" { s.conf.InterfaceName = conf.InterfaceName </s> remove if js.Exists("enabled") { s.conf.Enabled = newconfig.Enabled </s> add if conf.Enabled != nbNull { s.conf.Enabled = conf.Enabled == nbTrue </s> remove s.conf.Enabled = config.Enabled s.conf.InterfaceName = config.InterfaceName s.conf.HTTPRegister = config.HTTPRegister s.conf.ConfigModified = config.ConfigModified s.conf.DBFilePath = filepath.Join(config.WorkDir, dbFilename) </s> add s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename)
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep keep replace replace replace keep replace keep keep
<mask> return 0, nil <mask> } <mask> <mask> func (s *Server) handleDHCPSetConfig(w http.ResponseWriter, r *http.Request) { <mask> newconfig := dhcpServerConfigJSON{} <mask> newconfig.Enabled = s.conf.Enabled <mask> newconfig.InterfaceName = s.conf.InterfaceName <mask> <mask> js, err := jsonutil.DecodeObject(&newconfig, r.Body) <mask> if err != nil { <mask> httpError(r, w, http.StatusBadRequest, "Failed to parse new DHCP config json: %s", err) </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove httpError(r, w, http.StatusBadRequest, "Failed to parse new DHCP config json: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "failed to parse new dhcp config json: %s", err) </s> add type dhcpServerConfigJSON struct { V4 *v4ServerConfJSON `json:"v4"` V6 *v6ServerConfJSON `json:"v6"` InterfaceName string `json:"interface_name"` Enabled nullBool `json:"enabled"` } </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> remove if js.Exists("interface_name") { s.conf.InterfaceName = newconfig.InterfaceName </s> add if conf.InterfaceName != "" { s.conf.InterfaceName = conf.InterfaceName
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep keep replace keep keep keep keep keep
<mask> newconfig.InterfaceName = s.conf.InterfaceName <mask> <mask> js, err := jsonutil.DecodeObject(&newconfig, r.Body) <mask> if err != nil { <mask> httpError(r, w, http.StatusBadRequest, "Failed to parse new DHCP config json: %s", err) <mask> <mask> return <mask> } <mask> <mask> var s4 DHCPServer </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove js, err := jsonutil.DecodeObject(&newconfig, r.Body) </s> add err := json.NewDecoder(r.Body).Decode(&conf) </s> remove newconfig := dhcpServerConfigJSON{} newconfig.Enabled = s.conf.Enabled newconfig.InterfaceName = s.conf.InterfaceName </s> add conf := dhcpServerConfigJSON{} conf.Enabled = boolToNullBool(s.conf.Enabled) conf.InterfaceName = s.conf.InterfaceName </s> remove if js.Exists("interface_name") { s.conf.InterfaceName = newconfig.InterfaceName </s> add if conf.InterfaceName != "" { s.conf.InterfaceName = conf.InterfaceName </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> remove code, err = s.enableDHCP(newconfig.InterfaceName) </s> add code, err = s.enableDHCP(conf.InterfaceName)
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep replace replace replace replace replace keep keep replace replace
<mask> v4Enabled := false <mask> v6Enabled := false <mask> <mask> if js.Exists("v4") { <mask> v4conf := v4JSONToServerConf(newconfig.V4) <mask> v4conf.Enabled = newconfig.Enabled <mask> if len(v4conf.RangeStart) == 0 { <mask> v4conf.Enabled = false <mask> } <mask> <mask> v4Enabled = v4conf.Enabled <mask> v4conf.InterfaceName = newconfig.InterfaceName </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove v4conf := config.Conf4 </s> add v4conf := conf.Conf4 </s> remove if js.Exists("v6") { v6conf := v6JSONToServerConf(newconfig.V6) v6conf.Enabled = newconfig.Enabled if len(v6conf.RangeStart) == 0 { v6conf.Enabled = false </s> add if conf.V6 != nil { v6Conf := v6JSONToServerConf(conf.V6) v6Conf.Enabled = conf.Enabled == nbTrue if len(v6Conf.RangeStart) == 0 { v6Conf.Enabled = false </s> remove v6conf := config.Conf6 </s> add v6conf := conf.Conf6 </s> remove v6Enabled = v6conf.Enabled v6conf.InterfaceName = newconfig.InterfaceName v6conf.notify = s.onNotify </s> add // Don't overwrite the RA/SLAAC settings from the config file. // // TODO(a.garipov): Perhaps include them into the request to // allow changing them from the HTTP API? v6Conf.RASLAACOnly = s.conf.Conf6.RASLAACOnly v6Conf.RAAllowSLAAC = s.conf.Conf6.RAAllowSLAAC v6Enabled = v6Conf.Enabled v6Conf.InterfaceName = conf.InterfaceName v6Conf.notify = s.onNotify </s> remove if js.Exists("enabled") { s.conf.Enabled = newconfig.Enabled </s> add if conf.Enabled != nbNull { s.conf.Enabled = conf.Enabled == nbTrue
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep replace replace keep replace keep keep keep
<mask> c4 := V4ServerConf{} <mask> s.srv4.WriteDiskConfig4(&c4) <mask> v4conf.notify = c4.notify <mask> v4conf.ICMPTimeout = c4.ICMPTimeout <mask> <mask> s4, err = v4Create(v4conf) <mask> if err != nil { <mask> httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) <mask> </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> remove v4Enabled = v4conf.Enabled v4conf.InterfaceName = newconfig.InterfaceName </s> add v4Enabled = v4Conf.Enabled v4Conf.InterfaceName = conf.InterfaceName </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> remove s6, err = v6Create(v6conf) </s> add s6, err = v6Create(v6Conf) </s> remove v6Enabled = v6conf.Enabled v6conf.InterfaceName = newconfig.InterfaceName v6conf.notify = s.onNotify </s> add // Don't overwrite the RA/SLAAC settings from the config file. // // TODO(a.garipov): Perhaps include them into the request to // allow changing them from the HTTP API? v6Conf.RASLAACOnly = s.conf.Conf6.RASLAACOnly v6Conf.RAAllowSLAAC = s.conf.Conf6.RAAllowSLAAC v6Enabled = v6Conf.Enabled v6Conf.InterfaceName = conf.InterfaceName v6Conf.notify = s.onNotify
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep keep replace keep keep keep keep keep
<mask> v4conf.ICMPTimeout = c4.ICMPTimeout <mask> <mask> s4, err = v4Create(v4conf) <mask> if err != nil { <mask> httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) <mask> <mask> return <mask> } <mask> } <mask> </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove s4, err = v4Create(v4conf) </s> add s4, err = v4Create(v4Conf) </s> remove v4conf.notify = c4.notify v4conf.ICMPTimeout = c4.ICMPTimeout </s> add v4Conf.notify = c4.notify v4Conf.ICMPTimeout = c4.ICMPTimeout </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> remove s6, err = v6Create(v6conf) </s> add s6, err = v6Create(v6Conf) </s> remove code, err = s.enableDHCP(newconfig.InterfaceName) </s> add code, err = s.enableDHCP(conf.InterfaceName) </s> remove httpError(r, w, http.StatusBadRequest, "Failed to parse new DHCP config json: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "failed to parse new dhcp config json: %s", err)
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep keep replace replace replace replace replace keep keep replace replace replace keep keep keep
<mask> return <mask> } <mask> } <mask> <mask> if js.Exists("v6") { <mask> v6conf := v6JSONToServerConf(newconfig.V6) <mask> v6conf.Enabled = newconfig.Enabled <mask> if len(v6conf.RangeStart) == 0 { <mask> v6conf.Enabled = false <mask> } <mask> <mask> v6Enabled = v6conf.Enabled <mask> v6conf.InterfaceName = newconfig.InterfaceName <mask> v6conf.notify = s.onNotify <mask> <mask> s6, err = v6Create(v6conf) <mask> if err != nil { </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove v6conf := config.Conf6 </s> add v6conf := conf.Conf6 </s> remove s6, err = v6Create(v6conf) </s> add s6, err = v6Create(v6Conf) </s> remove if js.Exists("v4") { v4conf := v4JSONToServerConf(newconfig.V4) v4conf.Enabled = newconfig.Enabled if len(v4conf.RangeStart) == 0 { v4conf.Enabled = false </s> add if conf.V4 != nil { v4Conf := v4JSONToServerConf(conf.V4) v4Conf.Enabled = conf.Enabled == nbTrue if len(v4Conf.RangeStart) == 0 { v4Conf.Enabled = false </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> remove if js.Exists("interface_name") { s.conf.InterfaceName = newconfig.InterfaceName </s> add if conf.InterfaceName != "" { s.conf.InterfaceName = conf.InterfaceName
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep keep replace keep replace keep
<mask> v6Enabled = v6conf.Enabled <mask> v6conf.InterfaceName = newconfig.InterfaceName <mask> v6conf.notify = s.onNotify <mask> <mask> s6, err = v6Create(v6conf) <mask> if err != nil { <mask> httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) <mask> </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove v6Enabled = v6conf.Enabled v6conf.InterfaceName = newconfig.InterfaceName v6conf.notify = s.onNotify </s> add // Don't overwrite the RA/SLAAC settings from the config file. // // TODO(a.garipov): Perhaps include them into the request to // allow changing them from the HTTP API? v6Conf.RASLAACOnly = s.conf.Conf6.RASLAACOnly v6Conf.RAAllowSLAAC = s.conf.Conf6.RAAllowSLAAC v6Enabled = v6Conf.Enabled v6Conf.InterfaceName = conf.InterfaceName v6Conf.notify = s.onNotify </s> remove if js.Exists("v6") { v6conf := v6JSONToServerConf(newconfig.V6) v6conf.Enabled = newconfig.Enabled if len(v6conf.RangeStart) == 0 { v6conf.Enabled = false </s> add if conf.V6 != nil { v6Conf := v6JSONToServerConf(conf.V6) v6Conf.Enabled = conf.Enabled == nbTrue if len(v6Conf.RangeStart) == 0 { v6Conf.Enabled = false </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> remove v4conf.notify = c4.notify v4conf.ICMPTimeout = c4.ICMPTimeout </s> add v4Conf.notify = c4.notify v4Conf.ICMPTimeout = c4.ICMPTimeout </s> remove s4, err = v4Create(v4conf) </s> add s4, err = v4Create(v4Conf)
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> return <mask> } <mask> } <mask> <mask> if newconfig.Enabled && !v4Enabled && !v6Enabled { <mask> httpError(r, w, http.StatusBadRequest, "dhcpv4 or dhcpv6 configuration must be complete") <mask> <mask> return <mask> } <mask> <mask> s.Stop() </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> add s.conf.Conf4 = conf.Conf4 s.conf.Conf6 = conf.Conf6 </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> remove if js.Exists("enabled") { s.conf.Enabled = newconfig.Enabled </s> add if conf.Enabled != nbNull { s.conf.Enabled = conf.Enabled == nbTrue </s> remove s6, err = v6Create(v6conf) </s> add s6, err = v6Create(v6Conf) </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> remove if s.conf.RaSlaacOnly { </s> add if s.conf.RASLAACOnly {
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep replace replace keep keep replace replace keep keep
<mask> <mask> s.Stop() <mask> <mask> if js.Exists("enabled") { <mask> s.conf.Enabled = newconfig.Enabled <mask> } <mask> <mask> if js.Exists("interface_name") { <mask> s.conf.InterfaceName = newconfig.InterfaceName <mask> } <mask> </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove if js.Exists("v6") { v6conf := v6JSONToServerConf(newconfig.V6) v6conf.Enabled = newconfig.Enabled if len(v6conf.RangeStart) == 0 { v6conf.Enabled = false </s> add if conf.V6 != nil { v6Conf := v6JSONToServerConf(conf.V6) v6Conf.Enabled = conf.Enabled == nbTrue if len(v6Conf.RangeStart) == 0 { v6Conf.Enabled = false </s> remove js, err := jsonutil.DecodeObject(&newconfig, r.Body) </s> add err := json.NewDecoder(r.Body).Decode(&conf) </s> remove newconfig := dhcpServerConfigJSON{} newconfig.Enabled = s.conf.Enabled newconfig.InterfaceName = s.conf.InterfaceName </s> add conf := dhcpServerConfigJSON{} conf.Enabled = boolToNullBool(s.conf.Enabled) conf.InterfaceName = s.conf.InterfaceName </s> remove if js.Exists("v4") { v4conf := v4JSONToServerConf(newconfig.V4) v4conf.Enabled = newconfig.Enabled if len(v4conf.RangeStart) == 0 { v4conf.Enabled = false </s> add if conf.V4 != nil { v4Conf := v4JSONToServerConf(conf.V4) v4Conf.Enabled = conf.Enabled == nbTrue if len(v4Conf.RangeStart) == 0 { v4Conf.Enabled = false </s> remove if newconfig.Enabled && !v4Enabled && !v6Enabled { httpError(r, w, http.StatusBadRequest, "dhcpv4 or dhcpv6 configuration must be complete") </s> add if conf.Enabled == nbTrue && !v4Enabled && !v6Enabled { httpError(r, w, http.StatusBadRequest, "dhcpv4 or dhcpv6 configuration must be complete")
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep keep replace keep keep keep keep keep
<mask> s.dbLoad() <mask> <mask> if s.conf.Enabled { <mask> var code int <mask> code, err = s.enableDHCP(newconfig.InterfaceName) <mask> if err != nil { <mask> httpError(r, w, code, "enabling dhcp: %s", err) <mask> <mask> return <mask> } </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> remove httpError(r, w, http.StatusBadRequest, "Failed to parse new DHCP config json: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "failed to parse new dhcp config json: %s", err) </s> remove s4, err = v4Create(v4conf) </s> add s4, err = v4Create(v4Conf) </s> add if errors.Is(err, os.ErrNotExist) { err = nil continue } </s> remove js, err := jsonutil.DecodeObject(&newconfig, r.Body) </s> add err := json.NewDecoder(r.Body).Decode(&conf)
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/dhcphttp.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> "golang.org/x/net/ipv6" <mask> ) <mask> <mask> type raCtx struct { <mask> raAllowSlaac bool // send RA packets without MO flags <mask> raSlaacOnly bool // send RA packets with MO flags <mask> ipAddr net.IP // source IP address (link-local-unicast) <mask> dnsIPAddr net.IP // IP address for DNS Server option <mask> prefixIPAddr net.IP // IP address for Prefix option <mask> ifaceName string <mask> iface *net.Interface </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove RaSlaacOnly bool `yaml:"ra_slaac_only" json:"-"` // send ICMPv6.RA packets without MO flags RaAllowSlaac bool `yaml:"ra_allow_slaac" json:"-"` // send ICMPv6.RA packets with MO flags </s> add RASLAACOnly bool `yaml:"ra_slaac_only" json:"-"` // send ICMPv6.RA packets without MO flags RAAllowSLAAC bool `yaml:"ra_allow_slaac" json:"-"` // send ICMPv6.RA packets with MO flags </s> remove if !(ra.raAllowSlaac || ra.raSlaacOnly) { </s> add if !(ra.raAllowSLAAC || ra.raSLAACOnly) { </s> remove managedAddressConfiguration: !ra.raSlaacOnly, otherConfiguration: !ra.raSlaacOnly, </s> add managedAddressConfiguration: !ra.raSLAACOnly, otherConfiguration: !ra.raSLAACOnly, </s> remove type dhcpServerConfigJSON struct { Enabled bool `json:"enabled"` InterfaceName string `json:"interface_name"` V4 v4ServerConfJSON `json:"v4"` V6 v6ServerConfJSON `json:"v6"` } </s> add </s> remove s.conf.Enabled = config.Enabled s.conf.InterfaceName = config.InterfaceName s.conf.HTTPRegister = config.HTTPRegister s.conf.ConfigModified = config.ConfigModified s.conf.DBFilePath = filepath.Join(config.WorkDir, dbFilename) </s> add s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> remove v6Enabled = v6conf.Enabled v6conf.InterfaceName = newconfig.InterfaceName v6conf.notify = s.onNotify </s> add // Don't overwrite the RA/SLAAC settings from the config file. // // TODO(a.garipov): Perhaps include them into the request to // allow changing them from the HTTP API? v6Conf.RASLAACOnly = s.conf.Conf6.RASLAACOnly v6Conf.RAAllowSLAAC = s.conf.Conf6.RAAllowSLAAC v6Enabled = v6Conf.Enabled v6Conf.InterfaceName = conf.InterfaceName v6Conf.notify = s.onNotify
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/routeradv.go
keep keep keep keep replace keep keep keep keep keep
<mask> // Init - initialize RA module <mask> func (ra *raCtx) Init() error { <mask> ra.stop.Store(0) <mask> ra.conn = nil <mask> if !(ra.raAllowSlaac || ra.raSlaacOnly) { <mask> return nil <mask> } <mask> <mask> log.Debug("dhcpv6 ra: source IP address: %s DNS IP address: %s", <mask> ra.ipAddr, ra.dnsIPAddr) </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove managedAddressConfiguration: !ra.raSlaacOnly, otherConfiguration: !ra.raSlaacOnly, </s> add managedAddressConfiguration: !ra.raSLAACOnly, otherConfiguration: !ra.raSLAACOnly, </s> remove raAllowSlaac bool // send RA packets without MO flags raSlaacOnly bool // send RA packets with MO flags </s> add raAllowSLAAC bool // send RA packets without MO flags raSLAACOnly bool // send RA packets with MO flags </s> remove if s.conf.RaSlaacOnly { </s> add if s.conf.RASLAACOnly { </s> remove func Create(config ServerConfig) *Server { </s> add func Create(conf ServerConfig) *Server { </s> remove s.conf.Enabled = config.Enabled s.conf.InterfaceName = config.InterfaceName s.conf.HTTPRegister = config.HTTPRegister s.conf.ConfigModified = config.ConfigModified s.conf.DBFilePath = filepath.Join(config.WorkDir, dbFilename) </s> add s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> remove func v6JSONToServerConf(j v6ServerConfJSON) V6ServerConf { </s> add func v6JSONToServerConf(j *v6ServerConfJSON) V6ServerConf { if j == nil { return V6ServerConf{} }
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/routeradv.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> log.Debug("dhcpv6 ra: source IP address: %s DNS IP address: %s", <mask> ra.ipAddr, ra.dnsIPAddr) <mask> <mask> params := icmpv6RA{ <mask> managedAddressConfiguration: !ra.raSlaacOnly, <mask> otherConfiguration: !ra.raSlaacOnly, <mask> mtu: uint32(ra.iface.MTU), <mask> prefixLen: 64, <mask> recursiveDNSServer: ra.dnsIPAddr, <mask> sourceLinkLayerAddress: ra.iface.HardwareAddr, <mask> } </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove if !(ra.raAllowSlaac || ra.raSlaacOnly) { </s> add if !(ra.raAllowSLAAC || ra.raSLAACOnly) { </s> remove raAllowSlaac bool // send RA packets without MO flags raSlaacOnly bool // send RA packets with MO flags </s> add raAllowSLAAC bool // send RA packets without MO flags raSLAACOnly bool // send RA packets with MO flags </s> remove RaSlaacOnly bool `yaml:"ra_slaac_only" json:"-"` // send ICMPv6.RA packets without MO flags RaAllowSlaac bool `yaml:"ra_allow_slaac" json:"-"` // send ICMPv6.RA packets with MO flags </s> add RASLAACOnly bool `yaml:"ra_slaac_only" json:"-"` // send ICMPv6.RA packets without MO flags RAAllowSLAAC bool `yaml:"ra_allow_slaac" json:"-"` // send ICMPv6.RA packets with MO flags </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> remove js, err := jsonutil.DecodeObject(&newconfig, r.Body) </s> add err := json.NewDecoder(r.Body).Decode(&conf)
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/routeradv.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> RangeStart net.IP `yaml:"range_start"` <mask> <mask> LeaseDuration uint32 `yaml:"lease_duration" json:"lease_duration"` // in seconds <mask> <mask> RaSlaacOnly bool `yaml:"ra_slaac_only" json:"-"` // send ICMPv6.RA packets without MO flags <mask> RaAllowSlaac bool `yaml:"ra_allow_slaac" json:"-"` // send ICMPv6.RA packets with MO flags <mask> <mask> ipStart net.IP // starting IP address for dynamic leases <mask> leaseTime time.Duration // the time during which a dynamic lease is considered valid <mask> dnsIPAddrs []net.IP // IPv6 addresses to return to DHCP clients as DNS server addresses <mask> </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove raAllowSlaac bool // send RA packets without MO flags raSlaacOnly bool // send RA packets with MO flags </s> add raAllowSLAAC bool // send RA packets without MO flags raSLAACOnly bool // send RA packets with MO flags </s> remove if s.conf.RaSlaacOnly { </s> add if s.conf.RASLAACOnly { </s> remove s.conf.Enabled = config.Enabled s.conf.InterfaceName = config.InterfaceName s.conf.HTTPRegister = config.HTTPRegister s.conf.ConfigModified = config.ConfigModified s.conf.DBFilePath = filepath.Join(config.WorkDir, dbFilename) </s> add s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> remove v6Enabled = v6conf.Enabled v6conf.InterfaceName = newconfig.InterfaceName v6conf.notify = s.onNotify </s> add // Don't overwrite the RA/SLAAC settings from the config file. // // TODO(a.garipov): Perhaps include them into the request to // allow changing them from the HTTP API? v6Conf.RASLAACOnly = s.conf.Conf6.RASLAACOnly v6Conf.RAAllowSLAAC = s.conf.Conf6.RAAllowSLAAC v6Enabled = v6Conf.Enabled v6Conf.InterfaceName = conf.InterfaceName v6Conf.notify = s.onNotify </s> remove if !(ra.raAllowSlaac || ra.raSlaacOnly) { </s> add if !(ra.raAllowSLAAC || ra.raSLAACOnly) { </s> remove func v6JSONToServerConf(j v6ServerConfJSON) V6ServerConf { </s> add func v6JSONToServerConf(j *v6ServerConfJSON) V6ServerConf { if j == nil { return V6ServerConf{} }
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/server.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> break <mask> } <mask> } <mask> <mask> s.ra.raAllowSlaac = s.conf.RaAllowSlaac <mask> s.ra.raSlaacOnly = s.conf.RaSlaacOnly <mask> s.ra.dnsIPAddr = s.ra.ipAddr <mask> s.ra.prefixIPAddr = s.conf.ipStart <mask> s.ra.ifaceName = s.conf.InterfaceName <mask> s.ra.iface = iface <mask> s.ra.packetSendPeriod = 1 * time.Second </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove if js.Exists("interface_name") { s.conf.InterfaceName = newconfig.InterfaceName </s> add if conf.InterfaceName != "" { s.conf.InterfaceName = conf.InterfaceName </s> remove v6conf := config.Conf6 </s> add v6conf := conf.Conf6 </s> remove v4conf := config.Conf4 </s> add v4conf := conf.Conf4 </s> remove if js.Exists("enabled") { s.conf.Enabled = newconfig.Enabled </s> add if conf.Enabled != nbNull { s.conf.Enabled = conf.Enabled == nbTrue </s> remove v4Enabled = v4conf.Enabled v4conf.InterfaceName = newconfig.InterfaceName </s> add v4Enabled = v4Conf.Enabled v4Conf.InterfaceName = conf.InterfaceName </s> remove if js.Exists("v6") { v6conf := v6JSONToServerConf(newconfig.V6) v6conf.Enabled = newconfig.Enabled if len(v6conf.RangeStart) == 0 { v6conf.Enabled = false </s> add if conf.V6 != nil { v6Conf := v6JSONToServerConf(conf.V6) v6Conf.Enabled = conf.Enabled == nbTrue if len(v6Conf.RangeStart) == 0 { v6Conf.Enabled = false
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/v6.go
keep keep keep keep replace keep keep keep keep keep
<mask> return err <mask> } <mask> <mask> // don't initialize DHCPv6 server if we must force the clients to use SLAAC <mask> if s.conf.RaSlaacOnly { <mask> log.Debug("DHCPv6: not starting DHCPv6 server due to ra_slaac_only=true") <mask> return nil <mask> } <mask> <mask> log.Debug("dhcpv6: listening...") </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> add s.conf.Conf4 = conf.Conf4 s.conf.Conf6 = conf.Conf6 </s> remove RaSlaacOnly bool `yaml:"ra_slaac_only" json:"-"` // send ICMPv6.RA packets without MO flags RaAllowSlaac bool `yaml:"ra_allow_slaac" json:"-"` // send ICMPv6.RA packets with MO flags </s> add RASLAACOnly bool `yaml:"ra_slaac_only" json:"-"` // send ICMPv6.RA packets without MO flags RAAllowSLAAC bool `yaml:"ra_allow_slaac" json:"-"` // send ICMPv6.RA packets with MO flags </s> remove v6Enabled = v6conf.Enabled v6conf.InterfaceName = newconfig.InterfaceName v6conf.notify = s.onNotify </s> add // Don't overwrite the RA/SLAAC settings from the config file. // // TODO(a.garipov): Perhaps include them into the request to // allow changing them from the HTTP API? v6Conf.RASLAACOnly = s.conf.Conf6.RASLAACOnly v6Conf.RAAllowSLAAC = s.conf.Conf6.RAAllowSLAAC v6Enabled = v6Conf.Enabled v6Conf.InterfaceName = conf.InterfaceName v6Conf.notify = s.onNotify </s> remove s.conf.Enabled = config.Enabled s.conf.InterfaceName = config.InterfaceName s.conf.HTTPRegister = config.HTTPRegister s.conf.ConfigModified = config.ConfigModified s.conf.DBFilePath = filepath.Join(config.WorkDir, dbFilename) </s> add s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> remove if newconfig.Enabled && !v4Enabled && !v6Enabled { httpError(r, w, http.StatusBadRequest, "dhcpv4 or dhcpv6 configuration must be complete") </s> add if conf.Enabled == nbTrue && !v4Enabled && !v6Enabled { httpError(r, w, http.StatusBadRequest, "dhcpv4 or dhcpv6 configuration must be complete") </s> remove if !(ra.raAllowSlaac || ra.raSlaacOnly) { </s> add if !(ra.raAllowSLAAC || ra.raSLAACOnly) {
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/dhcpd/v6.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> checker: ifacesStaticConfig, <mask> filePath: "/etc/network/interfaces", <mask> }} { <mask> f, err = os.Open(check.filePath) <mask> if errors.Is(err, os.ErrNotExist) { <mask> continue <mask> } <mask> if err != nil { <mask> return false, err <mask> } <mask> defer f.Close() <mask> </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> add if errors.Is(err, os.ErrNotExist) { err = nil continue } </s> remove fileReadCloser, err := aghio.LimitReadCloser(f, maxConfigFileSize) </s> add var fileReadCloser io.ReadCloser fileReadCloser, err = aghio.LimitReadCloser(f, maxConfigFileSize) </s> remove if js.Exists("interface_name") { s.conf.InterfaceName = newconfig.InterfaceName </s> add if conf.InterfaceName != "" { s.conf.InterfaceName = conf.InterfaceName </s> remove code, err = s.enableDHCP(newconfig.InterfaceName) </s> add code, err = s.enableDHCP(conf.InterfaceName) </s> remove if js.Exists("v6") { v6conf := v6JSONToServerConf(newconfig.V6) v6conf.Enabled = newconfig.Enabled if len(v6conf.RangeStart) == 0 { v6conf.Enabled = false </s> add if conf.V6 != nil { v6Conf := v6JSONToServerConf(conf.V6) v6Conf.Enabled = conf.Enabled == nbTrue if len(v6Conf.RangeStart) == 0 { v6Conf.Enabled = false </s> remove if js.Exists("enabled") { s.conf.Enabled = newconfig.Enabled </s> add if conf.Enabled != nbNull { s.conf.Enabled = conf.Enabled == nbTrue
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/sysutil/net_linux.go
keep add keep keep keep keep keep
<mask> f, err = os.Open(check.filePath) <mask> if err != nil { <mask> return false, err <mask> } <mask> defer f.Close() <mask> <mask> var fileReadCloser io.ReadCloser </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> remove fileReadCloser, err := aghio.LimitReadCloser(f, maxConfigFileSize) </s> add var fileReadCloser io.ReadCloser fileReadCloser, err = aghio.LimitReadCloser(f, maxConfigFileSize) </s> remove if errors.Is(err, os.ErrNotExist) { continue } </s> add </s> remove code, err = s.enableDHCP(newconfig.InterfaceName) </s> add code, err = s.enableDHCP(conf.InterfaceName) </s> remove type dhcpServerConfigJSON struct { Enabled bool `json:"enabled"` InterfaceName string `json:"interface_name"` V4 v4ServerConfJSON `json:"v4"` V6 v6ServerConfJSON `json:"v6"` } </s> add </s> remove s4, err = v4Create(v4conf) </s> add s4, err = v4Create(v4Conf) </s> remove s6, err = v6Create(v6conf) </s> add s6, err = v6Create(v6Conf)
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/sysutil/net_linux.go
keep keep keep keep replace keep keep keep keep keep
<mask> return false, err <mask> } <mask> defer f.Close() <mask> <mask> fileReadCloser, err := aghio.LimitReadCloser(f, maxConfigFileSize) <mask> if err != nil { <mask> return false, err <mask> } <mask> defer fileReadCloser.Close() <mask> </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> add if errors.Is(err, os.ErrNotExist) { err = nil continue } </s> remove if errors.Is(err, os.ErrNotExist) { continue } </s> add </s> remove code, err = s.enableDHCP(newconfig.InterfaceName) </s> add code, err = s.enableDHCP(conf.InterfaceName) </s> remove type dhcpServerConfigJSON struct { Enabled bool `json:"enabled"` InterfaceName string `json:"interface_name"` V4 v4ServerConfJSON `json:"v4"` V6 v6ServerConfJSON `json:"v6"` } </s> add </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv6 configuration: %s", err) </s> remove httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err) </s> add httpError(r, w, http.StatusBadRequest, "invalid dhcpv4 configuration: %s", err)
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
internal/sysutil/net_linux.go
keep keep add keep keep keep keep keep keep
<mask> , "MX" <mask> , "PTR" <mask> , "QUIC" <mask> , "SDNS" <mask> , "SLAAC" <mask> , "SVCB" <mask> ] <mask> dot_import_whitelist = [] <mask> http_status_code_whitelist = [] </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> add , "SLAAC" </s> remove s.ra.raAllowSlaac = s.conf.RaAllowSlaac s.ra.raSlaacOnly = s.conf.RaSlaacOnly </s> add s.ra.raAllowSLAAC = s.conf.RAAllowSLAAC s.ra.raSLAACOnly = s.conf.RASLAACOnly </s> remove v4Enabled = v4conf.Enabled v4conf.InterfaceName = newconfig.InterfaceName </s> add v4Enabled = v4Conf.Enabled v4Conf.InterfaceName = conf.InterfaceName </s> remove v6conf := config.Conf6 </s> add v6conf := conf.Conf6 </s> remove v4conf.notify = c4.notify v4conf.ICMPTimeout = c4.ICMPTimeout </s> add v4Conf.notify = c4.notify v4Conf.ICMPTimeout = c4.ICMPTimeout </s> remove s6, err = v6Create(v6conf) </s> add s6, err = v6Create(v6Conf)
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
staticcheck.conf
keep add keep keep keep keep
<mask> , "RA" <mask> , "SDNS" <mask> , "SVCB" <mask> ] <mask> dot_import_whitelist = [] <mask> http_status_code_whitelist = [] </s> Pull request: dhcpd: do not override ra-slaac settings Merge in DNS/adguard-home from 2653-ra-slaac to master Updates #2653. Squashed commit of the following: commit f261413a58dc813e37cc848606ed490b8c0ac9f3 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:37:13 2021 +0300 all: doc changes, rm debug commit 4a8c6e4897579493c1ca242fb8f0f440c3b51a74 Author: Ainar Garipov <[email protected]> Date: Thu Feb 11 20:11:46 2021 +0300 dhcpd: do not override ra-slaac settings </s> add , "RA" </s> remove s.ra.raAllowSlaac = s.conf.RaAllowSlaac s.ra.raSlaacOnly = s.conf.RaSlaacOnly </s> add s.ra.raAllowSLAAC = s.conf.RAAllowSLAAC s.ra.raSLAACOnly = s.conf.RASLAACOnly </s> remove v4Enabled = v4conf.Enabled v4conf.InterfaceName = newconfig.InterfaceName </s> add v4Enabled = v4Conf.Enabled v4Conf.InterfaceName = conf.InterfaceName </s> remove v6conf := config.Conf6 </s> add v6conf := conf.Conf6 </s> remove v4conf.notify = c4.notify v4conf.ICMPTimeout = c4.ICMPTimeout </s> add v4Conf.notify = c4.notify v4Conf.ICMPTimeout = c4.ICMPTimeout </s> remove s6, err = v6Create(v6conf) </s> add s6, err = v6Create(v6Conf)
https://github.com/AdguardTeam/AdGuardHome/commit/2eb21ef40901e893069e9e4b6fa902d759d510b5
staticcheck.conf
keep keep add keep keep keep keep
<mask> // resolving PTR queries for local addresses. <mask> LocalPTRResolvers []string <mask> <mask> // ResolveClients signals if the RDNS should resolve clients' addresses. <mask> ResolveClients bool <mask> <mask> // UsePrivateRDNS defines if the PTR requests for unknown addresses from </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> add // UseDNS64 defines if DNS64 should be used for incoming requests. UseDNS64 bool `yaml:"use_dns64"` // DNS64Prefixes is the list of NAT64 prefixes to be used for DNS64. DNS64Prefixes []string `yaml:"dns64_prefixes"` </s> add // UseDNS64 defines if DNS64 is enabled for incoming requests. UseDNS64 bool </s> add if s.shouldStripDNS64(ip) { // Strip the prefix from the address to get the original IPv4. ip = ip[nat64PrefixLen:] // Treat a DNS64-prefixed address as a locally served one since those // queries should never be sent to the global DNS. dctx.unreversedReqIP = ip } </s> remove // processRecursion checks the incoming request and halts it's handling if s // have tried to resolve it recently. </s> add // processRecursion checks the incoming request and halts its handling by // answering NXDOMAIN if s has tried to resolve it recently. </s> remove // unreversedReqIP stores an IP address obtained from PTR request if it // parsed successfully and belongs to one of locally-served IP ranges as per // RFC 6303. </s> add // unreversedReqIP stores an IP address obtained from a PTR request if it // was parsed successfully and belongs to one of the locally served IP // ranges. It is also filled with unmapped version of the address if it's // within DNS64 prefixes. </s> remove // isLocalClient shows if client's IP address is from locally-served </s> add // isLocalClient shows if client's IP address is from locally served
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/config.go
keep keep add keep keep keep keep
<mask> // locally-served networks should be resolved via private PTR resolvers. <mask> UsePrivateRDNS bool <mask> <mask> // ServeHTTP3 defines if HTTP/3 is be allowed for incoming requests. <mask> ServeHTTP3 bool <mask> <mask> // UseHTTP3Upstreams defines if HTTP/3 is be allowed for DNS-over-HTTPS </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> add // UseDNS64 defines if DNS64 should be used for incoming requests. UseDNS64 bool `yaml:"use_dns64"` // DNS64Prefixes is the list of NAT64 prefixes to be used for DNS64. DNS64Prefixes []string `yaml:"dns64_prefixes"` </s> add // DNS64Prefixes is a slice of NAT64 prefixes to be used for DNS64. DNS64Prefixes []string </s> remove // isLocalClient shows if client's IP address is from locally-served </s> add // isLocalClient shows if client's IP address is from locally served </s> remove // assume that all the DHCP leases we give are locally-served or at least // don't need to be accessible externally. </s> add // assume that all the DHCP leases we give are locally served or at least // shouldn't be accessible externally. </s> add if s.shouldStripDNS64(ip) { // Strip the prefix from the address to get the original IPv4. ip = ip[nat64PrefixLen:] // Treat a DNS64-prefixed address as a locally served one since those // queries should never be sent to the global DNS. dctx.unreversedReqIP = ip } </s> remove log.Debug("dnsforward: addr %s is not from locally-served network", ip) </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/config.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> // origResp is the response received from upstream. It is set when the <mask> // response is modified by filters. <mask> origResp *dns.Msg <mask> <mask> // unreversedReqIP stores an IP address obtained from PTR request if it <mask> // parsed successfully and belongs to one of locally-served IP ranges as per <mask> // RFC 6303. <mask> unreversedReqIP net.IP <mask> <mask> // err is the error returned from a processing function. <mask> err error <mask> </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove // isLocalClient shows if client's IP address is from locally-served </s> add // isLocalClient shows if client's IP address is from locally served </s> remove // the server. </s> add // the server. It responds with a mapped IP address if the DNS64 is enabled and // the request is for AAAA. </s> remove // processDetermineLocal determines if the client's IP address is from // locally-served network and saves the result into the context. </s> add // processDetermineLocal determines if the client's IP address is from locally // served network and saves the result into the context. </s> remove // code is only executed when the request is for locally-served ARPA </s> add // code is only executed when the request is for locally served ARPA </s> add // UseDNS64 defines if DNS64 should be used for incoming requests. UseDNS64 bool `yaml:"use_dns64"` // DNS64Prefixes is the list of NAT64 prefixes to be used for DNS64. DNS64Prefixes []string `yaml:"dns64_prefixes"` </s> add // dns64Prefix is the set of NAT64 prefixes used for DNS64 handling. dns64Prefs []netip.Prefix
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> // responseAD shows if the response had the AD bit set. <mask> responseAD bool <mask> <mask> // isLocalClient shows if client's IP address is from locally-served <mask> // network. <mask> isLocalClient bool <mask> } <mask> <mask> // resultCode is the result of a request processing function. </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove // unreversedReqIP stores an IP address obtained from PTR request if it // parsed successfully and belongs to one of locally-served IP ranges as per // RFC 6303. </s> add // unreversedReqIP stores an IP address obtained from a PTR request if it // was parsed successfully and belongs to one of the locally served IP // ranges. It is also filled with unmapped version of the address if it's // within DNS64 prefixes. </s> remove // processDetermineLocal determines if the client's IP address is from // locally-served network and saves the result into the context. </s> add // processDetermineLocal determines if the client's IP address is from locally // served network and saves the result into the context. </s> add // UseDNS64 defines if DNS64 should be used for incoming requests. UseDNS64 bool `yaml:"use_dns64"` // DNS64Prefixes is the list of NAT64 prefixes to be used for DNS64. DNS64Prefixes []string `yaml:"dns64_prefixes"` </s> add // DNS64Prefixes is a slice of NAT64 prefixes to be used for DNS64. DNS64Prefixes []string </s> remove // the server. </s> add // the server. It responds with a mapped IP address if the DNS64 is enabled and // the request is for AAAA. </s> add // dns64Prefix is the set of NAT64 prefixes used for DNS64 handling. dns64Prefs []netip.Prefix
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> return nil <mask> } <mask> <mask> // processRecursion checks the incoming request and halts it's handling if s <mask> // have tried to resolve it recently. <mask> func (s *Server) processRecursion(dctx *dnsContext) (rc resultCode) { <mask> pctx := dctx.proxyCtx <mask> <mask> if msg := pctx.Req; msg != nil && s.recDetector.check(*msg) { <mask> log.Debug("recursion detected resolving %q", msg.Question[0].Name) </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove // the server. </s> add // the server. It responds with a mapped IP address if the DNS64 is enabled and // the request is for AAAA. </s> remove // in locally-served network from external clients. </s> add // in locally served network from external clients. </s> remove // processDetermineLocal determines if the client's IP address is from // locally-served network and saves the result into the context. </s> add // processDetermineLocal determines if the client's IP address is from locally // served network and saves the result into the context. </s> remove if !webRegistered && s.conf.HTTPRegister != nil { webRegistered = true s.registerHandlers() </s> add s.registerHandlers() err = s.setupDNS64() if err != nil { return fmt.Errorf("preparing DNS64: %w", err) </s> remove if req.AuthenticatedData { origReqAD = true } else { </s> add origReqAD = req.AuthenticatedData if !req.AuthenticatedData { </s> remove // TODO(a.garipov): Remove once we switch to netip.Addr more fully. </s> add // TODO(a.garipov): Remove once we switch to [netip.Addr] more fully.
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> return resp <mask> } <mask> <mask> // processDetermineLocal determines if the client's IP address is from <mask> // locally-served network and saves the result into the context. <mask> func (s *Server) processDetermineLocal(dctx *dnsContext) (rc resultCode) { <mask> rc = resultCodeSuccess <mask> <mask> var ip net.IP <mask> if ip, _ = netutil.IPAndPortFromAddr(dctx.proxyCtx.Addr); ip == nil { </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove // the server. </s> add // the server. It responds with a mapped IP address if the DNS64 is enabled and // the request is for AAAA. </s> remove // in locally-served network from external clients. </s> add // in locally served network from external clients. </s> remove // processRecursion checks the incoming request and halts it's handling if s // have tried to resolve it recently. </s> add // processRecursion checks the incoming request and halts its handling by // answering NXDOMAIN if s has tried to resolve it recently. </s> remove // isLocalClient shows if client's IP address is from locally-served </s> add // isLocalClient shows if client's IP address is from locally served </s> remove // TODO(a.garipov): Remove once we switch to netip.Addr more fully. </s> add // TODO(a.garipov): Remove once we switch to [netip.Addr] more fully. </s> add if s.shouldStripDNS64(ip) { // Strip the prefix from the address to get the original IPv4. ip = ip[nat64PrefixLen:] // Treat a DNS64-prefixed address as a locally served one since those // queries should never be sent to the global DNS. dctx.unreversedReqIP = ip }
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> return ip, ok <mask> } <mask> <mask> // processDHCPHosts respond to A requests if the target hostname is known to <mask> // the server. <mask> // <mask> // TODO(a.garipov): Adapt to AAAA as well. <mask> func (s *Server) processDHCPHosts(dctx *dnsContext) (rc resultCode) { <mask> pctx := dctx.proxyCtx <mask> req := pctx.Req </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove // in locally-served network from external clients. </s> add // in locally served network from external clients. </s> remove // processRecursion checks the incoming request and halts it's handling if s // have tried to resolve it recently. </s> add // processRecursion checks the incoming request and halts its handling by // answering NXDOMAIN if s has tried to resolve it recently. </s> remove // processDetermineLocal determines if the client's IP address is from // locally-served network and saves the result into the context. </s> add // processDetermineLocal determines if the client's IP address is from locally // served network and saves the result into the context. </s> remove // TODO(a.garipov): Remove once we switch to netip.Addr more fully. </s> add // TODO(a.garipov): Remove once we switch to [netip.Addr] more fully. </s> add // UseDNS64 defines if DNS64 should be used for incoming requests. UseDNS64 bool `yaml:"use_dns64"` // DNS64Prefixes is the list of NAT64 prefixes to be used for DNS64. DNS64Prefixes []string `yaml:"dns64_prefixes"` </s> add if s.shouldStripDNS64(ip) { // Strip the prefix from the address to get the original IPv4. ip = ip[nat64PrefixLen:] // Treat a DNS64-prefixed address as a locally served one since those // queries should never be sent to the global DNS. dctx.unreversedReqIP = ip }
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> log.Debug("dnsforward: dhcp record for %q is %s", reqHost, ip) <mask> <mask> resp := s.makeResponse(req) <mask> if q.Qtype == dns.TypeA { <mask> a := &dns.A{ <mask> Hdr: s.hdr(req, dns.TypeA), <mask> A: ip.AsSlice(), <mask> } <mask> resp.Answer = append(resp.Answer, a) </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> add case dns.TypeAAAA: if len(s.dns64Prefs) > 0 { // Respond with DNS64-mapped address for IPv4 host if DNS64 is // enabled. aaaa := &dns.AAAA{ Hdr: s.hdr(req, dns.TypeAAAA), AAAA: s.mapDNS64(ip), } resp.Answer = append(resp.Answer, aaaa) } default: // Go on. </s> add log.Debug("dnsforward: addr %s is from locally served network", ip) </s> remove // TODO(a.garipov): Remove once we switch to netip.Addr more fully. </s> add // TODO(a.garipov): Remove once we switch to [netip.Addr] more fully. </s> remove log.Debug("dnsforward: addr %s is not from locally-served network", ip) </s> add </s> remove // in locally-served network from external clients. </s> add // in locally served network from external clients. </s> remove // processDetermineLocal determines if the client's IP address is from // locally-served network and saves the result into the context. </s> add // processDetermineLocal determines if the client's IP address is from locally // served network and saves the result into the context.
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep add keep keep keep keep keep
<mask> } <mask> resp.Answer = append(resp.Answer, a) <mask> } <mask> <mask> dctx.proxyCtx.Res = resp <mask> <mask> return resultCodeSuccess </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove if q.Qtype == dns.TypeA { </s> add switch q.Qtype { case dns.TypeA: </s> remove // processDetermineLocal determines if the client's IP address is from // locally-served network and saves the result into the context. </s> add // processDetermineLocal determines if the client's IP address is from locally // served network and saves the result into the context. </s> remove if !s.privateNets.Contains(ip) { return resultCodeSuccess } </s> add </s> add if s.performDNS64(prx, dctx) == resultCodeError { return resultCodeError } </s> remove // assume that all the DHCP leases we give are locally-served or at least // don't need to be accessible externally. </s> add // assume that all the DHCP leases we give are locally served or at least // shouldn't be accessible externally. </s> remove // TODO(a.garipov): Remove once we switch to netip.Addr more fully. </s> add // TODO(a.garipov): Remove once we switch to [netip.Addr] more fully.
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> return resultCodeSuccess <mask> } <mask> <mask> // processRestrictLocal responds with NXDOMAIN to PTR requests for IP addresses <mask> // in locally-served network from external clients. <mask> func (s *Server) processRestrictLocal(dctx *dnsContext) (rc resultCode) { <mask> pctx := dctx.proxyCtx <mask> req := pctx.Req <mask> q := req.Question[0] <mask> if q.Qtype != dns.TypePTR { </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove // the server. </s> add // the server. It responds with a mapped IP address if the DNS64 is enabled and // the request is for AAAA. </s> remove // processRecursion checks the incoming request and halts it's handling if s // have tried to resolve it recently. </s> add // processRecursion checks the incoming request and halts its handling by // answering NXDOMAIN if s has tried to resolve it recently. </s> remove // processDetermineLocal determines if the client's IP address is from // locally-served network and saves the result into the context. </s> add // processDetermineLocal determines if the client's IP address is from locally // served network and saves the result into the context. </s> remove log.Debug("dnsforward: addr %s is not from locally-served network", ip) </s> add </s> remove // TODO(a.garipov): Remove once we switch to netip.Addr more fully. </s> add // TODO(a.garipov): Remove once we switch to [netip.Addr] more fully. </s> remove if !s.privateNets.Contains(ip) { return resultCodeSuccess } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep add keep keep keep keep keep keep
<mask> } <mask> <mask> // Restrict an access to local addresses for external clients. We also <mask> // assume that all the DHCP leases we give are locally served or at least <mask> // shouldn't be accessible externally. <mask> if !s.privateNets.Contains(ip) { <mask> return resultCodeSuccess <mask> } </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove // assume that all the DHCP leases we give are locally-served or at least // don't need to be accessible externally. </s> add // assume that all the DHCP leases we give are locally served or at least // shouldn't be accessible externally. </s> remove log.Debug("dnsforward: addr %s is not from locally-served network", ip) </s> add </s> remove // in locally-served network from external clients. </s> add // in locally served network from external clients. </s> remove // TODO(a.garipov): Remove once we switch to netip.Addr more fully. </s> add // TODO(a.garipov): Remove once we switch to [netip.Addr] more fully. </s> remove // processDetermineLocal determines if the client's IP address is from // locally-served network and saves the result into the context. </s> add // processDetermineLocal determines if the client's IP address is from locally // served network and saves the result into the context. </s> add // DNS64Prefixes is a slice of NAT64 prefixes to be used for DNS64. DNS64Prefixes []string
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep replace replace keep replace replace keep keep keep keep
<mask> // Restrict an access to local addresses for external clients. We also <mask> // assume that all the DHCP leases we give are locally-served or at least <mask> // don't need to be accessible externally. <mask> if !s.privateNets.Contains(ip) { <mask> log.Debug("dnsforward: addr %s is not from locally-served network", ip) <mask> <mask> return resultCodeSuccess <mask> } <mask> <mask> if !dctx.isLocalClient { </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> add if s.shouldStripDNS64(ip) { // Strip the prefix from the address to get the original IPv4. ip = ip[nat64PrefixLen:] // Treat a DNS64-prefixed address as a locally served one since those // queries should never be sent to the global DNS. dctx.unreversedReqIP = ip } </s> add log.Debug("dnsforward: addr %s is from locally served network", ip) </s> remove // in locally-served network from external clients. </s> add // in locally served network from external clients. </s> remove // TODO(a.garipov): Remove once we switch to netip.Addr more fully. </s> add // TODO(a.garipov): Remove once we switch to [netip.Addr] more fully. </s> remove // code is only executed when the request is for locally-served ARPA </s> add // code is only executed when the request is for locally served ARPA
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep add keep keep keep keep
<mask> } <mask> <mask> if !dctx.isLocalClient { <mask> log.Debug("dnsforward: %q requests an internal ip", pctx.Addr) <mask> pctx.Res = s.genNXDomain(req) <mask> </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove log.Debug("dnsforward: addr %s is not from locally-served network", ip) </s> add </s> remove if q.Qtype == dns.TypeA { </s> add switch q.Qtype { case dns.TypeA: </s> remove // assume that all the DHCP leases we give are locally-served or at least // don't need to be accessible externally. </s> add // assume that all the DHCP leases we give are locally served or at least // shouldn't be accessible externally. </s> remove // TODO(a.garipov): Remove once we switch to netip.Addr more fully. </s> add // TODO(a.garipov): Remove once we switch to [netip.Addr] more fully. </s> remove if req.AuthenticatedData { origReqAD = true } else { </s> add origReqAD = req.AuthenticatedData if !req.AuthenticatedData { </s> add if s.shouldStripDNS64(ip) { // Strip the prefix from the address to get the original IPv4. ip = ip[nat64PrefixLen:] // Treat a DNS64-prefixed address as a locally served one since those // queries should never be sent to the global DNS. dctx.unreversedReqIP = ip }
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> // Do not perform unreversing ever again. <mask> dctx.unreversedReqIP = ip <mask> <mask> // There is no need to filter request from external addresses since this <mask> // code is only executed when the request is for locally-served ARPA <mask> // hostname so disable redundant filters. <mask> dctx.setts.ParentalEnabled = false <mask> dctx.setts.SafeBrowsingEnabled = false <mask> dctx.setts.SafeSearchEnabled = false <mask> dctx.setts.ServicesRules = nil </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove if req.AuthenticatedData { origReqAD = true } else { </s> add origReqAD = req.AuthenticatedData if !req.AuthenticatedData { </s> remove // unreversedReqIP stores an IP address obtained from PTR request if it // parsed successfully and belongs to one of locally-served IP ranges as per // RFC 6303. </s> add // unreversedReqIP stores an IP address obtained from a PTR request if it // was parsed successfully and belongs to one of the locally served IP // ranges. It is also filled with unmapped version of the address if it's // within DNS64 prefixes. </s> add // UseDNS64 defines if DNS64 should be used for incoming requests. UseDNS64 bool `yaml:"use_dns64"` // DNS64Prefixes is the list of NAT64 prefixes to be used for DNS64. DNS64Prefixes []string `yaml:"dns64_prefixes"` </s> add if s.shouldStripDNS64(ip) { // Strip the prefix from the address to get the original IPv4. ip = ip[nat64PrefixLen:] // Treat a DNS64-prefixed address as a locally served one since those // queries should never be sent to the global DNS. dctx.unreversedReqIP = ip } </s> remove // the server. </s> add // the server. It responds with a mapped IP address if the DNS64 is enabled and // the request is for AAAA. </s> remove log.Debug("dnsforward: addr %s is not from locally-served network", ip) </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> if ip == nil { <mask> return resultCodeSuccess <mask> } <mask> <mask> // TODO(a.garipov): Remove once we switch to netip.Addr more fully. <mask> ipAddr, err := netutil.IPToAddrNoMapped(ip) <mask> if err != nil { <mask> log.Debug("dnsforward: bad reverse ip %v from dhcp: %s", ip, err) <mask> <mask> return resultCodeSuccess </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove if !webRegistered && s.conf.HTTPRegister != nil { webRegistered = true s.registerHandlers() </s> add s.registerHandlers() err = s.setupDNS64() if err != nil { return fmt.Errorf("preparing DNS64: %w", err) </s> remove if !s.privateNets.Contains(ip) { return resultCodeSuccess } </s> add </s> remove // processDetermineLocal determines if the client's IP address is from // locally-served network and saves the result into the context. </s> add // processDetermineLocal determines if the client's IP address is from locally // served network and saves the result into the context. </s> remove if q.Qtype == dns.TypeA { </s> add switch q.Qtype { case dns.TypeA: </s> add if s.shouldStripDNS64(ip) { // Strip the prefix from the address to get the original IPv4. ip = ip[nat64PrefixLen:] // Treat a DNS64-prefixed address as a locally served one since those // queries should never be sent to the global DNS. dctx.unreversedReqIP = ip } </s> remove log.Debug("dnsforward: addr %s is not from locally-served network", ip) </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> <mask> s.serverLock.RLock() <mask> defer s.serverLock.RUnlock() <mask> <mask> if !s.privateNets.Contains(ip) { <mask> return resultCodeSuccess <mask> } <mask> <mask> if s.conf.UsePrivateRDNS { <mask> s.recDetector.add(*pctx.Req) <mask> if err := s.localResolvers.Resolve(pctx); err != nil { <mask> dctx.err = err <mask> </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove if !webRegistered && s.conf.HTTPRegister != nil { webRegistered = true s.registerHandlers() </s> add s.registerHandlers() err = s.setupDNS64() if err != nil { return fmt.Errorf("preparing DNS64: %w", err) </s> remove // TODO(a.garipov): Remove once we switch to netip.Addr more fully. </s> add // TODO(a.garipov): Remove once we switch to [netip.Addr] more fully. </s> remove // processRecursion checks the incoming request and halts it's handling if s // have tried to resolve it recently. </s> add // processRecursion checks the incoming request and halts its handling by // answering NXDOMAIN if s has tried to resolve it recently. </s> remove // in locally-served network from external clients. </s> add // in locally served network from external clients. </s> remove if req.AuthenticatedData { origReqAD = true } else { </s> add origReqAD = req.AuthenticatedData if !req.AuthenticatedData { </s> add if s.performDNS64(prx, dctx) == resultCodeError { return resultCodeError }
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> s.setCustomUpstream(pctx, dctx.clientID) <mask> <mask> origReqAD := false <mask> if s.conf.EnableDNSSEC { <mask> if req.AuthenticatedData { <mask> origReqAD = true <mask> } else { <mask> req.AuthenticatedData = true <mask> } <mask> } <mask> <mask> // Process the request further since it wasn't filtered. </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> add if s.performDNS64(prx, dctx) == resultCodeError { return resultCodeError } </s> remove // processRecursion checks the incoming request and halts it's handling if s // have tried to resolve it recently. </s> add // processRecursion checks the incoming request and halts its handling by // answering NXDOMAIN if s has tried to resolve it recently. </s> remove if !webRegistered && s.conf.HTTPRegister != nil { webRegistered = true s.registerHandlers() </s> add s.registerHandlers() err = s.setupDNS64() if err != nil { return fmt.Errorf("preparing DNS64: %w", err) </s> add if s.shouldStripDNS64(ip) { // Strip the prefix from the address to get the original IPv4. ip = ip[nat64PrefixLen:] // Treat a DNS64-prefixed address as a locally served one since those // queries should never be sent to the global DNS. dctx.unreversedReqIP = ip } </s> remove if !s.privateNets.Contains(ip) { return resultCodeSuccess } </s> add </s> remove // the server. </s> add // the server. It responds with a mapped IP address if the DNS64 is enabled and // the request is for AAAA.
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep keep add keep keep keep keep
<mask> return resultCodeError <mask> } <mask> <mask> dctx.responseFromUpstream = true <mask> dctx.responseAD = pctx.Res.AuthenticatedData <mask> <mask> if s.conf.EnableDNSSEC && !origReqAD { </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove if req.AuthenticatedData { origReqAD = true } else { </s> add origReqAD = req.AuthenticatedData if !req.AuthenticatedData { </s> remove if !webRegistered && s.conf.HTTPRegister != nil { webRegistered = true s.registerHandlers() </s> add s.registerHandlers() err = s.setupDNS64() if err != nil { return fmt.Errorf("preparing DNS64: %w", err) </s> remove // processRecursion checks the incoming request and halts it's handling if s // have tried to resolve it recently. </s> add // processRecursion checks the incoming request and halts its handling by // answering NXDOMAIN if s has tried to resolve it recently. </s> remove if !s.privateNets.Contains(ip) { return resultCodeSuccess } </s> add </s> add webRegistered = true </s> add case dns.TypeAAAA: if len(s.dns64Prefs) > 0 { // Respond with DNS64-mapped address for IPv4 host if DNS64 is // enabled. aaaa := &dns.AAAA{ Hdr: s.hdr(req, dns.TypeAAAA), AAAA: s.mapDNS64(ip), } resp.Answer = append(resp.Answer, aaaa) } default: // Go on.
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dns.go
keep keep keep add keep keep keep keep
<mask> localResolvers *proxy.Proxy <mask> sysResolvers aghnet.SystemResolvers <mask> recDetector *recursionDetector <mask> <mask> // anonymizer masks the client's IP addresses if needed. <mask> anonymizer *aghnet.IPMut <mask> <mask> tableHostToIP hostToIPTable </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove // isLocalClient shows if client's IP address is from locally-served </s> add // isLocalClient shows if client's IP address is from locally served </s> remove // processDetermineLocal determines if the client's IP address is from // locally-served network and saves the result into the context. </s> add // processDetermineLocal determines if the client's IP address is from locally // served network and saves the result into the context. </s> remove // unreversedReqIP stores an IP address obtained from PTR request if it // parsed successfully and belongs to one of locally-served IP ranges as per // RFC 6303. </s> add // unreversedReqIP stores an IP address obtained from a PTR request if it // was parsed successfully and belongs to one of the locally served IP // ranges. It is also filled with unmapped version of the address if it's // within DNS64 prefixes. </s> remove // the server. </s> add // the server. It responds with a mapped IP address if the DNS64 is enabled and // the request is for AAAA. </s> add // DNS64Prefixes is a slice of NAT64 prefixes to be used for DNS64. DNS64Prefixes []string </s> remove // in locally-served network from external clients. </s> add // in locally served network from external clients.
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dnsforward.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> if err != nil { <mask> return fmt.Errorf("preparing access: %w", err) <mask> } <mask> <mask> if !webRegistered && s.conf.HTTPRegister != nil { <mask> webRegistered = true <mask> s.registerHandlers() <mask> } <mask> <mask> s.dnsProxy = &proxy.Proxy{Config: proxyConfig} <mask> <mask> err = s.setupResolvers(s.conf.LocalPTRResolvers) </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove if !s.privateNets.Contains(ip) { return resultCodeSuccess } </s> add </s> remove // TODO(a.garipov): Remove once we switch to netip.Addr more fully. </s> add // TODO(a.garipov): Remove once we switch to [netip.Addr] more fully. </s> add if webRegistered || s.conf.HTTPRegister == nil { return } </s> add if s.performDNS64(prx, dctx) == resultCodeError { return resultCodeError } </s> remove // processRecursion checks the incoming request and halts it's handling if s // have tried to resolve it recently. </s> add // processRecursion checks the incoming request and halts its handling by // answering NXDOMAIN if s has tried to resolve it recently. </s> remove if req.AuthenticatedData { origReqAD = true } else { </s> add origReqAD = req.AuthenticatedData if !req.AuthenticatedData {
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/dnsforward.go
keep keep keep add keep keep keep keep keep keep
<mask> s.ServeHTTP(w, r) <mask> } <mask> <mask> func (s *Server) registerHandlers() { <mask> s.conf.HTTPRegister(http.MethodGet, "/control/dns_info", s.handleGetConfig) <mask> s.conf.HTTPRegister(http.MethodPost, "/control/dns_config", s.handleSetConfig) <mask> s.conf.HTTPRegister(http.MethodPost, "/control/test_upstream_dns", s.handleTestUpstreamDNS) <mask> <mask> s.conf.HTTPRegister(http.MethodGet, "/control/access/list", s.handleAccessList) <mask> s.conf.HTTPRegister(http.MethodPost, "/control/access/set", s.handleAccessSet) </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove // in locally-served network from external clients. </s> add // in locally served network from external clients. </s> remove // processDetermineLocal determines if the client's IP address is from // locally-served network and saves the result into the context. </s> add // processDetermineLocal determines if the client's IP address is from locally // served network and saves the result into the context. </s> remove // processRecursion checks the incoming request and halts it's handling if s // have tried to resolve it recently. </s> add // processRecursion checks the incoming request and halts its handling by // answering NXDOMAIN if s has tried to resolve it recently. </s> remove // the server. </s> add // the server. It responds with a mapped IP address if the DNS64 is enabled and // the request is for AAAA. </s> remove if req.AuthenticatedData { origReqAD = true } else { </s> add origReqAD = req.AuthenticatedData if !req.AuthenticatedData { </s> add if s.performDNS64(prx, dctx) == resultCodeError { return resultCodeError }
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/http.go
keep keep add keep
<mask> // See also https://github.com/AdguardTeam/AdGuardHome/issues/2628. <mask> s.conf.HTTPRegister("", "/dns-query", s.handleDoH) <mask> s.conf.HTTPRegister("", "/dns-query/", s.handleDoH) <mask> } </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> add if s.shouldStripDNS64(ip) { // Strip the prefix from the address to get the original IPv4. ip = ip[nat64PrefixLen:] // Treat a DNS64-prefixed address as a locally served one since those // queries should never be sent to the global DNS. dctx.unreversedReqIP = ip } </s> remove // assume that all the DHCP leases we give are locally-served or at least // don't need to be accessible externally. </s> add // assume that all the DHCP leases we give are locally served or at least // shouldn't be accessible externally. </s> remove log.Debug("dnsforward: addr %s is not from locally-served network", ip) </s> add </s> add case dns.TypeAAAA: if len(s.dns64Prefs) > 0 { // Respond with DNS64-mapped address for IPv4 host if DNS64 is // enabled. aaaa := &dns.AAAA{ Hdr: s.hdr(req, dns.TypeAAAA), AAAA: s.mapDNS64(ip), } resp.Answer = append(resp.Answer, aaaa) } default: // Go on. </s> remove // unreversedReqIP stores an IP address obtained from PTR request if it // parsed successfully and belongs to one of locally-served IP ranges as per // RFC 6303. </s> add // unreversedReqIP stores an IP address obtained from a PTR request if it // was parsed successfully and belongs to one of the locally served IP // ranges. It is also filled with unmapped version of the address if it's // within DNS64 prefixes. </s> remove // isLocalClient shows if client's IP address is from locally-served </s> add // isLocalClient shows if client's IP address is from locally served
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/dnsforward/http.go
keep keep keep add keep keep keep keep keep keep
<mask> // LocalPTRResolvers is the slice of addresses to be used as upstreams <mask> // for PTR queries for locally-served networks. <mask> LocalPTRResolvers []string `yaml:"local_ptr_upstreams"` <mask> <mask> // ServeHTTP3 defines if HTTP/3 is be allowed for incoming requests. <mask> // <mask> // TODO(a.garipov): Add to the UI when HTTP/3 support is no longer <mask> // experimental. <mask> ServeHTTP3 bool `yaml:"serve_http3"` <mask> </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> add // UseDNS64 defines if DNS64 is enabled for incoming requests. UseDNS64 bool </s> add // DNS64Prefixes is a slice of NAT64 prefixes to be used for DNS64. DNS64Prefixes []string </s> remove // unreversedReqIP stores an IP address obtained from PTR request if it // parsed successfully and belongs to one of locally-served IP ranges as per // RFC 6303. </s> add // unreversedReqIP stores an IP address obtained from a PTR request if it // was parsed successfully and belongs to one of the locally served IP // ranges. It is also filled with unmapped version of the address if it's // within DNS64 prefixes. </s> remove // code is only executed when the request is for locally-served ARPA </s> add // code is only executed when the request is for locally served ARPA </s> remove // isLocalClient shows if client's IP address is from locally-served </s> add // isLocalClient shows if client's IP address is from locally served </s> remove // the server. </s> add // the server. It responds with a mapped IP address if the DNS64 is enabled and // the request is for AAAA.
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/home/config.go
keep add keep keep keep keep keep keep
<mask> HTTPRegister: httpReg, <mask> OnDNSRequest: onDNSRequest, <mask> } <mask> <mask> if tlsConf.Enabled { <mask> newConf.TLSConfig = tlsConf.TLSConfig <mask> newConf.TLSConfig.ServerName = tlsConf.ServerName <mask> </s> Pull request: 5117-dns64 Merge in DNS/adguard-home from 5117-dns64 to master Updates #5117. Squashed commit of the following: commit 757d689134b85bdac9a6f5e43249866ec09ab7e3 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 19:06:18 2023 +0300 all: imp fmt commit b7a73c68c0b40bd3bda520c045c8110975c1827a Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 17:49:21 2023 +0300 all: rm unused, imp code commit 548feb6bd27b9774a9453d0570d37cdf557d4c3a Merge: de3e84b5 54a141ab Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 14:08:12 2023 +0300 Merge branch 'master' into 5117-dns64 commit de3e84b52b8dbff70df3ca0ac3315c3d33576334 Author: Eugene Burkov <[email protected]> Date: Mon Jan 23 12:04:48 2023 +0300 dnsforward: imp code commit a580e92119e3dbadc8b1a6572dbecc679f69db40 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:24:33 2023 +0400 dnsforward: try again commit 67b7a365194939fe15e4907a3dc2fee44b019d08 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 18:08:23 2023 +0400 dnsforward: fix test on linux commit ca83e4178a3383e326bf528d209d8766fb3c60d3 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:37:48 2023 +0400 dnsforward: imp naming commit c4e477c7a12af4966cbcd4e5f003a72966dc5d61 Merge: 42aa42a8 6e803375 Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:30:03 2023 +0400 Merge branch 'master' into 5117-dns64 commit 42aa42a8149b6bb42eb0da6e88ede4b5065bbf2f Author: Eugene Burkov <[email protected]> Date: Fri Jan 20 17:26:54 2023 +0400 dnsforward: imp test commit 4e91c675703f1453456ef9eea08157009ce6237a Author: Eugene Burkov <[email protected]> Date: Wed Jan 18 12:32:55 2023 +0400 dnsforward: imp code, docs, add test commit 766ef757f61e7a555b8151b4783fa7aba5f566f7 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 16:36:35 2023 +0400 dnsforward: imp docs commit 6825f372389988597d1879cf66342c410f3cfd47 Author: Eugene Burkov <[email protected]> Date: Tue Jan 17 14:33:33 2023 +0400 internal: imp code, docs commit 1215316a338496b5bea2b20d697c7451bfbcc84b Author: Eugene Burkov <[email protected]> Date: Fri Jan 13 21:24:50 2023 +0400 all: add dns64 support </s> remove if req.AuthenticatedData { origReqAD = true } else { </s> add origReqAD = req.AuthenticatedData if !req.AuthenticatedData { </s> add if s.performDNS64(prx, dctx) == resultCodeError { return resultCodeError } </s> remove if !s.privateNets.Contains(ip) { return resultCodeSuccess } </s> add </s> remove if !webRegistered && s.conf.HTTPRegister != nil { webRegistered = true s.registerHandlers() </s> add s.registerHandlers() err = s.setupDNS64() if err != nil { return fmt.Errorf("preparing DNS64: %w", err) </s> add case dns.TypeAAAA: if len(s.dns64Prefs) > 0 { // Respond with DNS64-mapped address for IPv4 host if DNS64 is // enabled. aaaa := &dns.AAAA{ Hdr: s.hdr(req, dns.TypeAAAA), AAAA: s.mapDNS64(ip), } resp.Answer = append(resp.Answer, aaaa) } default: // Go on. </s> add if webRegistered || s.conf.HTTPRegister == nil { return }
https://github.com/AdguardTeam/AdGuardHome/commit/2ecf2a4c42fbd7ea61573d35271ee65f335c7c4f
internal/home/dns.go
keep keep keep keep replace keep keep keep
<mask> // The syntax of the ipsetConf is: <mask> // <mask> // DOMAIN[,DOMAIN].../IPSET_NAME[,IPSET_NAME]... <mask> // <mask> // The error is of type *aghos.UnsupportedError if the OS is not supported. <mask> func NewIpsetManager(ipsetConf []string) (mgr IpsetManager, err error) { <mask> return newIpsetMgr(ipsetConf) <mask> } </s> Pull request: aghnet: fix ipset init errors Updates #4027. Squashed commit of the following: commit 9ac0cc27ca94e630cc321c90b60b271499af4d9b Author: Ainar Garipov <[email protected]> Date: Mon Dec 27 20:26:22 2021 +0300 aghnet: fix ipset init errors </s> add if len(ipsetConf) == 0 { return nil, nil } </s> remove dial := func(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { return ipset.Dial(pf, conf) </s> add return newIpsetMgrWithDialer(ipsetConf, defaultDial) } // defaultDial is the default netfilter dialing function. func defaultDial(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { conn, err = ipset.Dial(pf, conf) if err != nil { return nil, err </s> remove return newIpsetMgrWithDialer(ipsetConf, dial) </s> add return conn, nil </s> add if errors.Is(err, unix.EPROTONOSUPPORT) { // The implementation doesn't support this protocol version. Just // issue a warning. log.Info("ipset: dialing netfilter: warning: %s", err) return nil, nil } </s> remove // ipset cannot currently be initialized if the server was // installed from Snap or when the user or the binary doesn't // have the required permissions, or when the kernel doesn't // support netfilter. </s> add // ipset cannot currently be initialized if the server was installed // from Snap or when the user or the binary doesn't have the required // permissions, or when the kernel doesn't support netfilter. </s> remove // TODO(a.garipov): The Snap problem can probably be solved if // we add the netlink-connector interface plug. log.Info("warning: cannot initialize ipset: %s", err) </s> add // TODO(a.garipov): The Snap problem can probably be solved if we add // the netlink-connector interface plug. log.Info("ipset: warning: cannot initialize: %s", err)
https://github.com/AdguardTeam/AdGuardHome/commit/2ed1f939b59591335447d8b445c9d3832c772f09
internal/aghnet/ipset.go
keep add keep keep
<mask> // *aghos.UnsupportedError if the OS is not supported. <mask> func NewIpsetManager(ipsetConf []string) (mgr IpsetManager, err error) { <mask> return newIpsetMgr(ipsetConf) <mask> } </s> Pull request: aghnet: fix ipset init errors Updates #4027. Squashed commit of the following: commit 9ac0cc27ca94e630cc321c90b60b271499af4d9b Author: Ainar Garipov <[email protected]> Date: Mon Dec 27 20:26:22 2021 +0300 aghnet: fix ipset init errors </s> remove // The error is of type *aghos.UnsupportedError if the OS is not supported. </s> add // If ipsetConf is empty, msg and err are nil. The error is of type // *aghos.UnsupportedError if the OS is not supported. </s> remove dial := func(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { return ipset.Dial(pf, conf) </s> add return newIpsetMgrWithDialer(ipsetConf, defaultDial) } // defaultDial is the default netfilter dialing function. func defaultDial(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { conn, err = ipset.Dial(pf, conf) if err != nil { return nil, err </s> remove return newIpsetMgrWithDialer(ipsetConf, dial) </s> add return conn, nil </s> remove // TODO(a.garipov): Perhaps we can ditch package ipset altogether and // just use packages netfilter and netlink. </s> add // TODO(a.garipov): Perhaps we can ditch package ipset altogether and just // use packages netfilter and netlink. </s> add if errors.Is(err, unix.EPROTONOSUPPORT) { // The implementation doesn't support this protocol version. Just // issue a warning. log.Info("ipset: dialing netfilter: warning: %s", err) return nil, nil } </s> remove // ipset cannot currently be initialized if the server was // installed from Snap or when the user or the binary doesn't // have the required permissions, or when the kernel doesn't // support netfilter. </s> add // ipset cannot currently be initialized if the server was installed // from Snap or when the user or the binary doesn't have the required // permissions, or when the kernel doesn't support netfilter.
https://github.com/AdguardTeam/AdGuardHome/commit/2ed1f939b59591335447d8b445c9d3832c772f09
internal/aghnet/ipset.go
keep keep add keep keep keep keep keep
<mask> "github.com/digineo/go-ipset/v2" <mask> "github.com/mdlayher/netlink" <mask> "github.com/ti-mo/netfilter" <mask> ) <mask> <mask> // How to test on a real Linux machine: <mask> // <mask> // 1. Run: </s> Pull request: aghnet: fix ipset init errors Updates #4027. Squashed commit of the following: commit 9ac0cc27ca94e630cc321c90b60b271499af4d9b Author: Ainar Garipov <[email protected]> Date: Mon Dec 27 20:26:22 2021 +0300 aghnet: fix ipset init errors </s> remove dial := func(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { return ipset.Dial(pf, conf) </s> add return newIpsetMgrWithDialer(ipsetConf, defaultDial) } // defaultDial is the default netfilter dialing function. func defaultDial(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { conn, err = ipset.Dial(pf, conf) if err != nil { return nil, err </s> remove // ipset cannot currently be initialized if the server was // installed from Snap or when the user or the binary doesn't // have the required permissions, or when the kernel doesn't // support netfilter. </s> add // ipset cannot currently be initialized if the server was installed // from Snap or when the user or the binary doesn't have the required // permissions, or when the kernel doesn't support netfilter. </s> remove // The error is of type *aghos.UnsupportedError if the OS is not supported. </s> add // If ipsetConf is empty, msg and err are nil. The error is of type // *aghos.UnsupportedError if the OS is not supported. </s> remove // TODO(a.garipov): The Snap problem can probably be solved if // we add the netlink-connector interface plug. log.Info("warning: cannot initialize ipset: %s", err) </s> add // TODO(a.garipov): The Snap problem can probably be solved if we add // the netlink-connector interface plug. log.Info("ipset: warning: cannot initialize: %s", err) </s> remove // TODO(a.garipov): Perhaps we can ditch package ipset altogether and // just use packages netfilter and netlink. </s> add // TODO(a.garipov): Perhaps we can ditch package ipset altogether and just // use packages netfilter and netlink. </s> add if errors.Is(err, unix.EPROTONOSUPPORT) { // The implementation doesn't support this protocol version. Just // issue a warning. log.Info("ipset: dialing netfilter: warning: %s", err) return nil, nil }
https://github.com/AdguardTeam/AdGuardHome/commit/2ed1f939b59591335447d8b445c9d3832c772f09
internal/aghnet/ipset_linux.go
keep keep keep keep replace replace keep keep replace
<mask> // The Members field should contain the resolved IP addresses. <mask> <mask> // newIpsetMgr returns a new Linux ipset manager. <mask> func newIpsetMgr(ipsetConf []string) (set IpsetManager, err error) { <mask> dial := func(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { <mask> return ipset.Dial(pf, conf) <mask> } <mask> <mask> return newIpsetMgrWithDialer(ipsetConf, dial) </s> Pull request: aghnet: fix ipset init errors Updates #4027. Squashed commit of the following: commit 9ac0cc27ca94e630cc321c90b60b271499af4d9b Author: Ainar Garipov <[email protected]> Date: Mon Dec 27 20:26:22 2021 +0300 aghnet: fix ipset init errors </s> add if len(ipsetConf) == 0 { return nil, nil } </s> remove // The error is of type *aghos.UnsupportedError if the OS is not supported. </s> add // If ipsetConf is empty, msg and err are nil. The error is of type // *aghos.UnsupportedError if the OS is not supported. </s> remove // TODO(a.garipov): Perhaps we can ditch package ipset altogether and // just use packages netfilter and netlink. </s> add // TODO(a.garipov): Perhaps we can ditch package ipset altogether and just // use packages netfilter and netlink. </s> add if errors.Is(err, unix.EPROTONOSUPPORT) { // The implementation doesn't support this protocol version. Just // issue a warning. log.Info("ipset: dialing netfilter: warning: %s", err) return nil, nil } </s> remove // ipset cannot currently be initialized if the server was // installed from Snap or when the user or the binary doesn't // have the required permissions, or when the kernel doesn't // support netfilter. </s> add // ipset cannot currently be initialized if the server was installed // from Snap or when the user or the binary doesn't have the required // permissions, or when the kernel doesn't support netfilter.
https://github.com/AdguardTeam/AdGuardHome/commit/2ed1f939b59591335447d8b445c9d3832c772f09
internal/aghnet/ipset_linux.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> func (m *ipsetMgr) dialNetfilter(conf *netlink.Config) (err error) { <mask> // The kernel API does not actually require two sockets but package <mask> // github.com/digineo/go-ipset does. <mask> // <mask> // TODO(a.garipov): Perhaps we can ditch package ipset altogether and <mask> // just use packages netfilter and netlink. <mask> m.ipv4Conn, err = m.dial(netfilter.ProtoIPv4, conf) <mask> if err != nil { <mask> return fmt.Errorf("dialing v4: %w", err) <mask> } <mask> </s> Pull request: aghnet: fix ipset init errors Updates #4027. Squashed commit of the following: commit 9ac0cc27ca94e630cc321c90b60b271499af4d9b Author: Ainar Garipov <[email protected]> Date: Mon Dec 27 20:26:22 2021 +0300 aghnet: fix ipset init errors </s> remove dial := func(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { return ipset.Dial(pf, conf) </s> add return newIpsetMgrWithDialer(ipsetConf, defaultDial) } // defaultDial is the default netfilter dialing function. func defaultDial(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { conn, err = ipset.Dial(pf, conf) if err != nil { return nil, err </s> remove // ipset cannot currently be initialized if the server was // installed from Snap or when the user or the binary doesn't // have the required permissions, or when the kernel doesn't // support netfilter. </s> add // ipset cannot currently be initialized if the server was installed // from Snap or when the user or the binary doesn't have the required // permissions, or when the kernel doesn't support netfilter. </s> add if errors.Is(err, unix.EPROTONOSUPPORT) { // The implementation doesn't support this protocol version. Just // issue a warning. log.Info("ipset: dialing netfilter: warning: %s", err) return nil, nil } </s> remove // TODO(a.garipov): The Snap problem can probably be solved if // we add the netlink-connector interface plug. log.Info("warning: cannot initialize ipset: %s", err) </s> add // TODO(a.garipov): The Snap problem can probably be solved if we add // the netlink-connector interface plug. log.Info("ipset: warning: cannot initialize: %s", err) </s> remove return newIpsetMgrWithDialer(ipsetConf, dial) </s> add return conn, nil </s> remove // The error is of type *aghos.UnsupportedError if the OS is not supported. </s> add // If ipsetConf is empty, msg and err are nil. The error is of type // *aghos.UnsupportedError if the OS is not supported.
https://github.com/AdguardTeam/AdGuardHome/commit/2ed1f939b59591335447d8b445c9d3832c772f09
internal/aghnet/ipset_linux.go
keep add keep keep keep keep keep
<mask> err = m.dialNetfilter(&netlink.Config{}) <mask> if err != nil { <mask> return nil, fmt.Errorf("dialing netfilter: %w", err) <mask> } <mask> <mask> for i, confStr := range ipsetConf { <mask> var hosts, ipsetNames []string </s> Pull request: aghnet: fix ipset init errors Updates #4027. Squashed commit of the following: commit 9ac0cc27ca94e630cc321c90b60b271499af4d9b Author: Ainar Garipov <[email protected]> Date: Mon Dec 27 20:26:22 2021 +0300 aghnet: fix ipset init errors </s> remove log.Info("warning: %s", err) </s> add log.Info("ipset: warning: %s", err) </s> remove // TODO(a.garipov): Perhaps we can ditch package ipset altogether and // just use packages netfilter and netlink. </s> add // TODO(a.garipov): Perhaps we can ditch package ipset altogether and just // use packages netfilter and netlink. </s> remove dial := func(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { return ipset.Dial(pf, conf) </s> add return newIpsetMgrWithDialer(ipsetConf, defaultDial) } // defaultDial is the default netfilter dialing function. func defaultDial(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { conn, err = ipset.Dial(pf, conf) if err != nil { return nil, err </s> add if len(ipsetConf) == 0 { return nil, nil } </s> remove // The error is of type *aghos.UnsupportedError if the OS is not supported. </s> add // If ipsetConf is empty, msg and err are nil. The error is of type // *aghos.UnsupportedError if the OS is not supported. </s> remove return newIpsetMgrWithDialer(ipsetConf, dial) </s> add return conn, nil
https://github.com/AdguardTeam/AdGuardHome/commit/2ed1f939b59591335447d8b445c9d3832c772f09
internal/aghnet/ipset_linux.go
keep replace replace replace replace keep keep keep replace replace replace keep keep keep
<mask> if errors.Is(err, os.ErrInvalid) || errors.Is(err, os.ErrPermission) { <mask> // ipset cannot currently be initialized if the server was <mask> // installed from Snap or when the user or the binary doesn't <mask> // have the required permissions, or when the kernel doesn't <mask> // support netfilter. <mask> // <mask> // Log and go on. <mask> // <mask> // TODO(a.garipov): The Snap problem can probably be solved if <mask> // we add the netlink-connector interface plug. <mask> log.Info("warning: cannot initialize ipset: %s", err) <mask> <mask> return nil <mask> } else if unsupErr := (&aghos.UnsupportedError{}); errors.As(err, &unsupErr) { </s> Pull request: aghnet: fix ipset init errors Updates #4027. Squashed commit of the following: commit 9ac0cc27ca94e630cc321c90b60b271499af4d9b Author: Ainar Garipov <[email protected]> Date: Mon Dec 27 20:26:22 2021 +0300 aghnet: fix ipset init errors </s> remove log.Info("warning: %s", err) </s> add log.Info("ipset: warning: %s", err) </s> add if errors.Is(err, unix.EPROTONOSUPPORT) { // The implementation doesn't support this protocol version. Just // issue a warning. log.Info("ipset: dialing netfilter: warning: %s", err) return nil, nil } </s> remove // TODO(a.garipov): Perhaps we can ditch package ipset altogether and // just use packages netfilter and netlink. </s> add // TODO(a.garipov): Perhaps we can ditch package ipset altogether and just // use packages netfilter and netlink. </s> remove // The error is of type *aghos.UnsupportedError if the OS is not supported. </s> add // If ipsetConf is empty, msg and err are nil. The error is of type // *aghos.UnsupportedError if the OS is not supported. </s> add if len(ipsetConf) == 0 { return nil, nil }
https://github.com/AdguardTeam/AdGuardHome/commit/2ed1f939b59591335447d8b445c9d3832c772f09
internal/dnsforward/ipset.go
keep keep keep keep replace keep keep keep keep keep
<mask> log.Info("warning: cannot initialize ipset: %s", err) <mask> <mask> return nil <mask> } else if unsupErr := (&aghos.UnsupportedError{}); errors.As(err, &unsupErr) { <mask> log.Info("warning: %s", err) <mask> <mask> return nil <mask> } else if err != nil { <mask> return fmt.Errorf("initializing ipset: %w", err) <mask> } </s> Pull request: aghnet: fix ipset init errors Updates #4027. Squashed commit of the following: commit 9ac0cc27ca94e630cc321c90b60b271499af4d9b Author: Ainar Garipov <[email protected]> Date: Mon Dec 27 20:26:22 2021 +0300 aghnet: fix ipset init errors </s> remove // TODO(a.garipov): The Snap problem can probably be solved if // we add the netlink-connector interface plug. log.Info("warning: cannot initialize ipset: %s", err) </s> add // TODO(a.garipov): The Snap problem can probably be solved if we add // the netlink-connector interface plug. log.Info("ipset: warning: cannot initialize: %s", err) </s> add if errors.Is(err, unix.EPROTONOSUPPORT) { // The implementation doesn't support this protocol version. Just // issue a warning. log.Info("ipset: dialing netfilter: warning: %s", err) return nil, nil } </s> add if len(ipsetConf) == 0 { return nil, nil } </s> remove dial := func(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { return ipset.Dial(pf, conf) </s> add return newIpsetMgrWithDialer(ipsetConf, defaultDial) } // defaultDial is the default netfilter dialing function. func defaultDial(pf netfilter.ProtoFamily, conf *netlink.Config) (conn ipsetConn, err error) { conn, err = ipset.Dial(pf, conf) if err != nil { return nil, err </s> remove // TODO(a.garipov): Perhaps we can ditch package ipset altogether and // just use packages netfilter and netlink. </s> add // TODO(a.garipov): Perhaps we can ditch package ipset altogether and just // use packages netfilter and netlink. </s> remove return newIpsetMgrWithDialer(ipsetConf, dial) </s> add return conn, nil
https://github.com/AdguardTeam/AdGuardHome/commit/2ed1f939b59591335447d8b445c9d3832c772f09
internal/dnsforward/ipset.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> logBufferCap = 5000 // maximum capacity of buffer before it's flushed to disk <mask> queryLogFileName = "querylog.json" // .gz added during compression <mask> getDataLimit = 500 // GetData(): maximum log entries to return <mask> <mask> // maximum data chunks to parse when filtering entries <mask> maxFilteringChunks = 10 <mask> ) <mask> <mask> // queryLog is a structure that writes and reads the DNS query log <mask> type queryLog struct { <mask> conf Config </s> * querylog: major refactor: change on-disk format and API speed up decoding speed up search compatible with previous format (when not searching) </s> remove func (r *Reader) BeginRead(olderThan time.Time, count uint64) { </s> add func (r *Reader) BeginRead(olderThan time.Time, count uint64, search *getDataParams) { </s> remove func (l *queryLog) getData(params getDataParams) []map[string]interface{} { </s> add func (l *queryLog) getData(params getDataParams) map[string]interface{} { </s> add r.oldest = time.Time{} r.search = search </s> remove if len(params.Domain) != 0 && params.StrictMatchDomain { params.Domain = params.Domain + "." } </s> add var oldest time.Time </s> remove log.Debug("QueryLog: Failed to decode: %s", err) </s> add log.Debug("QueryLog: failed to decode") </s> remove log.Debug("Failed to unpack dns message answer: %s", err) </s> add log.Debug("Failed to unpack dns message answer: %s: %s", err, string(entry.Answer))
https://github.com/AdguardTeam/AdGuardHome/commit/2f5d6593f2d9841f9c18b9ac60a554af60a34a6b
querylog/qlog.go
keep replace keep keep replace keep keep
<mask> type logEntry struct { <mask> Question []byte <mask> Answer []byte `json:",omitempty"` // sometimes empty answers happen like binerdunt.top or rev2.globalrootservers.net <mask> Result dnsfilter.Result <mask> Time time.Time <mask> Elapsed time.Duration <mask> IP string </s> * querylog: major refactor: change on-disk format and API speed up decoding speed up search compatible with previous format (when not searching) </s> remove IP string </s> add </s> remove QuestionType uint16 // filter by question type </s> add QuestionType string // filter by question type </s> remove var q []byte var a []byte var err error ip := getIPString(addr) if question == nil { </s> add if question == nil || len(question.Question) != 1 || len(question.Question[0].Name) == 0 || ip == nil { </s> remove return entries, total </s> add return entries, oldest, int(total) </s> remove ql *queryLog </s> add ql *queryLog search *getDataParams
https://github.com/AdguardTeam/AdGuardHome/commit/2f5d6593f2d9841f9c18b9ac60a554af60a34a6b
querylog/qlog.go
keep keep keep keep replace keep keep keep keep keep
<mask> Answer []byte `json:",omitempty"` // sometimes empty answers happen like binerdunt.top or rev2.globalrootservers.net <mask> Result dnsfilter.Result <mask> Time time.Time <mask> Elapsed time.Duration <mask> IP string <mask> Upstream string `json:",omitempty"` // if empty, means it was cached <mask> } <mask> <mask> // getIPString is a helper function that extracts IP address from net.Addr <mask> func getIPString(addr net.Addr) string { </s> * querylog: major refactor: change on-disk format and API speed up decoding speed up search compatible with previous format (when not searching) </s> remove Time time.Time </s> add </s> remove Question []byte </s> add IP string `json:"IP"` Time time.Time `json:"T"` QHost string `json:"QH"` QType string `json:"QT"` QClass string `json:"QC"` </s> remove QuestionType uint16 // filter by question type </s> add QuestionType string // filter by question type </s> remove var q []byte var a []byte var err error ip := getIPString(addr) if question == nil { </s> add if question == nil || len(question.Question) != 1 || len(question.Question[0].Name) == 0 || ip == nil { </s> remove if len(params.Domain) != 0 && params.StrictMatchDomain { params.Domain = params.Domain + "." } </s> add var oldest time.Time </s> remove return entries, total </s> add return entries, oldest, int(total)
https://github.com/AdguardTeam/AdGuardHome/commit/2f5d6593f2d9841f9c18b9ac60a554af60a34a6b
querylog/qlog.go
keep keep keep replace replace replace replace replace replace keep keep keep replace replace replace replace replace keep keep
<mask> return <mask> } <mask> <mask> var q []byte <mask> var a []byte <mask> var err error <mask> ip := getIPString(addr) <mask> <mask> if question == nil { <mask> return <mask> } <mask> <mask> q, err = question.Pack() <mask> if err != nil { <mask> log.Printf("failed to pack question for querylog: %s", err) <mask> return <mask> } <mask> <mask> if answer != nil { </s> * querylog: major refactor: change on-disk format and API speed up decoding speed up search compatible with previous format (when not searching) </s> remove if len(entry.Question) == 0 { continue } q = new(dns.Msg) if err := q.Unpack(entry.Question); err != nil { log.Tracef("q.Unpack(): %s", err) continue } if len(q.Question) != 1 { log.Tracef("len(q.Question) != 1") continue } </s> add </s> remove log.Debug("QueryLog: Failed to decode: %s", err) </s> add log.Debug("QueryLog: failed to decode") </s> remove // read data var entry logEntry err = jd.Decode(&entry) </s> add val := readJSONValue(str, "T") if len(val) == 0 { val = readJSONValue(str, "Time") } if len(val) == 0 { log.Debug("QueryLog: failed to decode") continue } tm, err := time.Parse(time.RFC3339, val) </s> remove log.Debug("Failed to unpack dns message answer: %s", err) </s> add log.Debug("Failed to unpack dns message answer: %s: %s", err, string(entry.Answer)) </s> remove strReader := strings.NewReader(string(b)) jd := json.NewDecoder(strReader) </s> add str := string(b)
https://github.com/AdguardTeam/AdGuardHome/commit/2f5d6593f2d9841f9c18b9ac60a554af60a34a6b
querylog/qlog.go
keep keep keep replace keep keep replace keep
<mask> <mask> now := time.Now() <mask> entry := logEntry{ <mask> Question: q, <mask> Answer: a, <mask> Result: *result, <mask> Time: now, <mask> Elapsed: elapsed, </s> * querylog: major refactor: change on-disk format and API speed up decoding speed up search compatible with previous format (when not searching) </s> remove IP: ip, </s> add </s> add q := question.Question[0] entry.QHost = strings.ToLower(q.Name[:len(q.Name)-1]) // remove the last dot entry.QType = dns.Type(q.Qtype).String() entry.QClass = dns.Class(q.Qclass).String() </s> remove if len(params.Domain) != 0 && params.StrictMatchDomain { params.Domain = params.Domain + "." } </s> add var oldest time.Time </s> remove q, err = question.Pack() if err != nil { log.Printf("failed to pack question for querylog: %s", err) return } </s> add var a []byte var err error ip := getIPString(addr) </s> remove log.Debug("querylog: read %d entries in %v, %v/entry, seek-reqs:%d", r.count, elapsed, perunit, r.nSeekRequests) </s> add log.Debug("querylog: read %d entries in %v, %v/entry, seek-reqs:%d time:%dus (%d%%)", r.count, elapsed, perunit, r.nSeekRequests, r.timecnt/1000, r.timecnt*100/uint64(elapsed.Nanoseconds()))
https://github.com/AdguardTeam/AdGuardHome/commit/2f5d6593f2d9841f9c18b9ac60a554af60a34a6b
querylog/qlog.go
keep keep keep keep replace keep keep keep keep keep
<mask> Answer: a, <mask> Result: *result, <mask> Time: now, <mask> Elapsed: elapsed, <mask> IP: ip, <mask> Upstream: upstream, <mask> } <mask> <mask> l.bufferLock.Lock() <mask> l.buffer = append(l.buffer, &entry) </s> * querylog: major refactor: change on-disk format and API speed up decoding speed up search compatible with previous format (when not searching) </s> remove Time: now, </s> add </s> remove Question: q, </s> add IP: ip, Time: now, </s> add q := question.Question[0] entry.QHost = strings.ToLower(q.Name[:len(q.Name)-1]) // remove the last dot entry.QType = dns.Type(q.Qtype).String() entry.QClass = dns.Class(q.Qclass).String() </s> remove log.Debug("querylog: read %d entries in %v, %v/entry, seek-reqs:%d", r.count, elapsed, perunit, r.nSeekRequests) </s> add log.Debug("querylog: read %d entries in %v, %v/entry, seek-reqs:%d time:%dus (%d%%)", r.count, elapsed, perunit, r.nSeekRequests, r.timecnt/1000, r.timecnt*100/uint64(elapsed.Nanoseconds())) </s> remove q, err = question.Pack() if err != nil { log.Printf("failed to pack question for querylog: %s", err) return } </s> add var a []byte var err error ip := getIPString(addr) </s> remove r.searching = false </s> add r.seeking = false
https://github.com/AdguardTeam/AdGuardHome/commit/2f5d6593f2d9841f9c18b9ac60a554af60a34a6b
querylog/qlog.go
keep keep keep add keep keep keep keep keep keep
<mask> Result: *result, <mask> Elapsed: elapsed, <mask> Upstream: upstream, <mask> } <mask> <mask> l.bufferLock.Lock() <mask> l.buffer = append(l.buffer, &entry) <mask> needFlush := false <mask> if !l.flushPending { <mask> needFlush = len(l.buffer) >= logBufferCap </s> * querylog: major refactor: change on-disk format and API speed up decoding speed up search compatible with previous format (when not searching) </s> remove IP: ip, </s> add </s> remove Time: now, </s> add </s> remove Question: q, </s> add IP: ip, Time: now, </s> add if r.oldest.IsZero() { r.oldest = tm } </s> remove r.searching = false </s> add r.seeking = false </s> remove total++ if first { first = false olderThan = entry.Time } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2f5d6593f2d9841f9c18b9ac60a554af60a34a6b
querylog/qlog.go
keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep replace replace keep keep
<mask> <mask> if len(params.Domain) != 0 || params.QuestionType != 0 { <mask> m := dns.Msg{} <mask> _ = m.Unpack(entry.Question) <mask> <mask> if params.QuestionType != 0 { <mask> if m.Question[0].Qtype != params.QuestionType { <mask> return false <mask> } <mask> } <mask> <mask> if len(params.Domain) != 0 && params.StrictMatchDomain { <mask> if m.Question[0].Name != params.Domain { <mask> return false <mask> } <mask> } else if len(params.Domain) != 0 { <mask> if strings.Index(m.Question[0].Name, params.Domain) == -1 { <mask> return false <mask> } <mask> } <mask> } <mask> <mask> if len(params.Client) != 0 && params.StrictMatchClient { <mask> if entry.IP != params.Client { <mask> return false <mask> } </s> * querylog: major refactor: change on-disk format and API speed up decoding speed up search compatible with previous format (when not searching) </s> remove } else if len(params.Client) != 0 { if strings.Index(entry.IP, params.Client) == -1 { </s> add } if len(params.Client) != 0 { if (params.StrictMatchClient && entry.IP != params.Client) || (!params.StrictMatchClient && strings.Index(entry.IP, params.Client) == -1) { </s> remove params.QuestionType = qtype </s> add params.QuestionType = req.filterQuestionType </s> remove qtype, ok := dns.StringToType[req.filterQuestionType] </s> add _, ok := dns.StringToType[req.filterQuestionType] </s> remove func (l *queryLog) getData(params getDataParams) []map[string]interface{} { </s> add func (l *queryLog) getData(params getDataParams) map[string]interface{} { </s> remove if len(params.Domain) != 0 && params.StrictMatchDomain { params.Domain = params.Domain + "." } </s> add var oldest time.Time
https://github.com/AdguardTeam/AdGuardHome/commit/2f5d6593f2d9841f9c18b9ac60a554af60a34a6b
querylog/qlog.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> if len(params.Client) != 0 && params.StrictMatchClient { <mask> if entry.IP != params.Client { <mask> return false <mask> } <mask> } else if len(params.Client) != 0 { <mask> if strings.Index(entry.IP, params.Client) == -1 { <mask> return false <mask> } <mask> } <mask> <mask> return true </s> * querylog: major refactor: change on-disk format and API speed up decoding speed up search compatible with previous format (when not searching) </s> remove if len(params.Client) != 0 && params.StrictMatchClient { if entry.IP != params.Client { </s> add if len(params.Domain) != 0 { if (params.StrictMatchDomain && entry.QHost != params.Domain) || (!params.StrictMatchDomain && strings.Index(entry.QHost, params.Domain) == -1) { </s> remove if len(params.Domain) != 0 || params.QuestionType != 0 { m := dns.Msg{} _ = m.Unpack(entry.Question) if params.QuestionType != 0 { if m.Question[0].Qtype != params.QuestionType { return false } } if len(params.Domain) != 0 && params.StrictMatchDomain { if m.Question[0].Name != params.Domain { return false } } else if len(params.Domain) != 0 { if strings.Index(m.Question[0].Name, params.Domain) == -1 { return false } </s> add if len(params.QuestionType) != 0 { if entry.QType != params.QuestionType { return false </s> remove qtype, ok := dns.StringToType[req.filterQuestionType] </s> add _, ok := dns.StringToType[req.filterQuestionType] </s> remove var q []byte var a []byte var err error ip := getIPString(addr) if question == nil { </s> add if question == nil || len(question.Question) != 1 || len(question.Question[0].Name) == 0 || ip == nil { </s> remove total++ if first { first = false olderThan = entry.Time } </s> add </s> remove if len(entry.Question) == 0 { continue } q = new(dns.Msg) if err := q.Unpack(entry.Question); err != nil { log.Tracef("q.Unpack(): %s", err) continue } if len(q.Question) != 1 { log.Tracef("len(q.Question) != 1") continue } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/2f5d6593f2d9841f9c18b9ac60a554af60a34a6b
querylog/qlog.go
keep keep replace keep replace replace replace keep keep keep keep
<mask> } <mask> <mask> func (l *queryLog) readFromFile(params getDataParams) ([]*logEntry, int) { <mask> entries := []*logEntry{} <mask> olderThan := params.OlderThan <mask> totalChunks := 0 <mask> total := 0 <mask> <mask> r := l.OpenReader() <mask> if r == nil { <mask> return entries, 0 </s> * querylog: major refactor: change on-disk format and API speed up decoding speed up search compatible with previous format (when not searching) </s> remove return entries, 0 </s> add return entries, time.Time{}, 0 </s> remove r.BeginRead(olderThan, getDataLimit) for totalChunks < maxFilteringChunks { first := true </s> add r.BeginRead(params.OlderThan, getDataLimit, &params) total := uint64(0) for total <= maxSearchEntries { </s> remove func (l *queryLog) getData(params getDataParams) []map[string]interface{} { </s> add func (l *queryLog) getData(params getDataParams) map[string]interface{} { </s> remove if len(params.Domain) != 0 && params.StrictMatchDomain { params.Domain = params.Domain + "." } </s> add var oldest time.Time </s> remove entries, total = l.readFromFile(params) </s> add entries, oldest, total = l.readFromFile(params)
https://github.com/AdguardTeam/AdGuardHome/commit/2f5d6593f2d9841f9c18b9ac60a554af60a34a6b
querylog/qlog.go