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 keep keep keep keep keep
<mask> return resp <mask> } <mask> <mask> t.Run("same_name", func(t *testing.T) { <mask> resp := discoverAnOffer(t, staticName, anotherIP, anotherMAC) <mask> <mask> req, err := dhcpv4.NewRequestFromOffer(resp, dhcpv4.WithOption( <mask> dhcpv4.OptHostName(staticName), <mask> )) <mask> require.NoError(t, err) </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove resp := discoverAnOffer(t, anotherName, anotherIP, staticMAC) </s> add resp := discoverAnOffer(t, anotherName, anotherIP.AsSlice(), staticMAC) </s> remove s.conf.dnsIPAddrs = []net.IP{{192, 168, 10, 1}} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs...)) </s> add s.conf.dnsIPAddrs = []netip.Addr{netip.MustParseAddr("192.168.10.1")} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs[0].AsSlice())) </s> remove IP: anotherIP, </s> add IP: anotherIP.AsSlice(), </s> remove dhcpv4.WithGatewayIP(DefaultGatewayIP), </s> add dhcpv4.WithGatewayIP(DefaultGatewayIP.AsSlice()), </s> add laddr := netip.AddrPortFrom(IPv4Localhost(), 0) </s> remove l, err := net.Listen("tcp", "127.0.0.1:") </s> add l, err := net.Listen("tcp", laddr.String())
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> assert.Equal(t, aghnet.GenerateHostname(resp.YourIPAddr), resp.HostName()) <mask> }) <mask> <mask> t.Run("same_mac", func(t *testing.T) { <mask> resp := discoverAnOffer(t, anotherName, anotherIP, staticMAC) <mask> <mask> req, err := dhcpv4.NewRequestFromOffer(resp, dhcpv4.WithOption( <mask> dhcpv4.OptHostName(anotherName), <mask> )) <mask> require.NoError(t, err) </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove resp := discoverAnOffer(t, staticName, anotherIP, anotherMAC) </s> add resp := discoverAnOffer(t, staticName, anotherIP.AsSlice(), anotherMAC) </s> remove IP: anotherIP, </s> add IP: anotherIP.AsSlice(), </s> remove IP: anotherIP, </s> add IP: anotherIP.AsSlice(), </s> remove s.conf.dnsIPAddrs = []net.IP{{192, 168, 10, 1}} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs...)) </s> add s.conf.dnsIPAddrs = []netip.Addr{netip.MustParseAddr("192.168.10.1")} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs[0].AsSlice())) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove conn, err := net.ListenPacket("udp", "127.0.0.1:") </s> add conn, err := net.ListenPacket("udp", laddr.String())
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> }, { <mask> lease: &Lease{ <mask> Hostname: "probably-router.local", <mask> HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, <mask> IP: DefaultGatewayIP, <mask> }, <mask> name: "with_gateway_ip", <mask> wantErrMsg: "dhcpv4: adding static lease: " + <mask> "can't assign the gateway IP 192.168.10.1 to the lease", <mask> }, { </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove s.conf.dnsIPAddrs = []net.IP{{192, 168, 10, 1}} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs...)) </s> add dnsAddr := netip.MustParseAddr("192.168.10.1") s.conf.dnsIPAddrs = []netip.Addr{dnsAddr} s.implicitOpts.Update(dhcpv4.OptDNS(dnsAddr.AsSlice())) </s> remove s.conf.dnsIPAddrs = []net.IP{{192, 168, 10, 1}} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs...)) </s> add s.conf.dnsIPAddrs = []netip.Addr{netip.MustParseAddr("192.168.10.1")} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs[0].AsSlice())) </s> remove gatewayIP: net.IP{192, 168, 10, 120}, subnetMask: net.IP{255, 255, 255, 0}, </s> add </s> remove gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 240}, </s> add </s> remove name: "gateway_in_range", </s> add name: "gateway_in_range", gatewayIP: netip.MustParseAddr("192.168.10.120"), subnetMask: netip.MustParseAddr("255.255.255.0"), </s> remove name: "outside_range_start", </s> add name: "outside_range_start", gatewayIP: netip.MustParseAddr("192.168.10.1"), subnetMask: netip.MustParseAddr("255.255.255.240"),
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> } <mask> <mask> func TestV4Server_handle_optionsPriority(t *testing.T) { <mask> defaultIP := net.IP{192, 168, 1, 1} <mask> knownIP := net.IP{1, 2, 3, 4} <mask> <mask> // prepareSrv creates a *v4Server and sets the opt6IPs in the initial <mask> // configuration of the server as the value for DHCP option 6. <mask> prepareSrv := func(t *testing.T, opt6IPs []net.IP) (s *v4Server) { </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove DefaultRangeStart = net.IP{192, 168, 10, 100} DefaultRangeEnd = net.IP{192, 168, 10, 200} DefaultGatewayIP = net.IP{192, 168, 10, 1} DefaultSelfIP = net.IP{192, 168, 10, 2} DefaultSubnetMask = net.IP{255, 255, 255, 0} </s> add DefaultRangeStart = netip.MustParseAddr("192.168.10.100") DefaultRangeEnd = netip.MustParseAddr("192.168.10.200") DefaultGatewayIP = netip.MustParseAddr("192.168.10.1") DefaultSelfIP = netip.MustParseAddr("192.168.10.2") DefaultSubnetMask = netip.MustParseAddr("255.255.255.0") </s> remove dnsIPAddrs []net.IP // IPv4 addresses to return to DHCP clients as DNS server addresses </s> add dnsIPAddrs []netip.Addr // IPv4 addresses to return to DHCP clients as DNS server addresses </s> remove if !s.conf.subnet.Contains(reqIP) { </s> add if !s.conf.subnet.Contains(netip.AddrFrom4(*(*[4]byte)(ip4))) { </s> remove "github.com/AdguardTeam/golibs/netutil" </s> add </s> remove if ip4 := reqIP.To4(); ip4 == nil { </s> add ip4 := reqIP.To4() if ip4 == nil { </s> remove return Context.web.httpsServer.server != nil || aghnet.CheckPort("tcp", config.BindHost, port) == nil </s> add if Context.web.httpsServer.server != nil { return true } return aghnet.CheckPort("tcp", netip.AddrPortFrom(config.BindHost, uint16(port))) == nil
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> stringutil.WriteToBuilder(b, ",", ip.String()) <mask> } <mask> conf.Options = []string{b.String()} <mask> } else { <mask> defer func() { s.implicitOpts.Update(dhcpv4.OptDNS(defaultIP)) }() <mask> } <mask> <mask> var err error <mask> s, err = v4Create(conf) <mask> require.NoError(t, err) </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove s.conf.dnsIPAddrs = []net.IP{defaultIP} </s> add s.conf.dnsIPAddrs = []netip.Addr{defaultIP} </s> remove s.conf.dnsIPAddrs = []net.IP{{192, 168, 10, 1}} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs...)) </s> add s.conf.dnsIPAddrs = []netip.Addr{netip.MustParseAddr("192.168.10.1")} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs[0].AsSlice())) </s> add // // TODO(e.burkov): Use netip.Addr. </s> remove return nil, fmt.Errorf("couldn't get interfaces: %w", err) } else if len(ifaces) == 0 { return nil, errors.Error("couldn't find any legible interface") </s> add return nil, fmt.Errorf("failed to get addresses for interface %s: %w", iface.Name, err) </s> remove l, err := net.Listen("tcp", "127.0.0.1:") </s> add l, err := net.Listen("tcp", laddr.String()) </s> add laddr := netip.AddrPortFrom(IPv4Localhost(), 0)
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> var err error <mask> s, err = v4Create(conf) <mask> require.NoError(t, err) <mask> <mask> s.conf.dnsIPAddrs = []net.IP{defaultIP} <mask> <mask> return s <mask> } <mask> <mask> // checkResp creates a discovery message with DHCP option 6 requested amd </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove s.conf.dnsIPAddrs = []net.IP{{192, 168, 10, 1}} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs...)) </s> add s.conf.dnsIPAddrs = []netip.Addr{netip.MustParseAddr("192.168.10.1")} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs[0].AsSlice())) </s> remove defer func() { s.implicitOpts.Update(dhcpv4.OptDNS(defaultIP)) }() </s> add defer func() { s.implicitOpts.Update(dhcpv4.OptDNS(defaultIP.AsSlice())) }() </s> remove var subnet *net.IPNet </s> add var subnet netip.Prefix </s> remove s.conf.dnsIPAddrs = dnsIPAddrs </s> add for _, ip := range dnsIPAddrs { ip = ip.To4() if ip == nil { continue } s.conf.dnsIPAddrs = append(s.conf.dnsIPAddrs, netip.AddrFrom4(*(*[4]byte)(ip))) } </s> remove checkResp(t, s, []net.IP{defaultIP}) </s> add checkResp(t, s, []net.IP{defaultIP.AsSlice()}) </s> remove defaultIP := net.IP{192, 168, 1, 1} </s> add defaultIP := netip.MustParseAddr("192.168.1.1")
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> t.Run("default", func(t *testing.T) { <mask> s := prepareSrv(t, nil) <mask> <mask> checkResp(t, s, []net.IP{defaultIP}) <mask> }) <mask> <mask> t.Run("explicitly_configured", func(t *testing.T) { <mask> s := prepareSrv(t, []net.IP{knownIP, knownIP}) <mask> </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove // Just to avoid nil pointer dereference. subnet: &net.IPNet{}, </s> add </s> remove err := CheckPort("bad_network", nil, 0) </s> add err := CheckPort("bad_network", netip.AddrPortFrom(netip.Addr{}, 0)) </s> remove err := CheckPort("udp", net.IP{0, 0, 0, 0}, 0) </s> add err := CheckPort("udp", netip.AddrPortFrom(netip.IPv4Unspecified(), 0)) </s> remove bc := BroadcastFromIPNet(tc.subnet) assert.True(t, bc.Equal(tc.want), bc) </s> add assert.Equal(t, tc.want, BroadcastFromPref(tc.pref)) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove IP: anotherIP, </s> add IP: anotherIP.AsSlice(),
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> s, ok := sIface.(*v4Server) <mask> require.True(t, ok) <mask> <mask> s.conf.dnsIPAddrs = []net.IP{{192, 168, 10, 1}} <mask> s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs...)) <mask> <mask> l := &Lease{ <mask> Hostname: "static-1.local", <mask> HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, <mask> IP: net.IP{192, 168, 10, 150}, </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove s.conf.dnsIPAddrs = []net.IP{{192, 168, 10, 1}} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs...)) </s> add s.conf.dnsIPAddrs = []netip.Addr{netip.MustParseAddr("192.168.10.1")} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs[0].AsSlice())) </s> remove IP: DefaultGatewayIP, </s> add IP: DefaultGatewayIP.AsSlice(), </s> remove ip4, ip6 := net.IP{1, 2, 3, 4}, net.IP{0xAA, 0xAA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1} mask4, mask6 := net.CIDRMask(24, netutil.IPv4BitLen), net.CIDRMask(8, netutil.IPv6BitLen) </s> add ip4, ok := netip.AddrFromSlice([]byte{1, 2, 3, 4}) require.True(t, ok) ip6, ok := netip.AddrFromSlice([]byte{0xAA, 0xAA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}) require.True(t, ok) net4 := netip.PrefixFrom(ip4, 24) net6 := netip.PrefixFrom(ip6, 8) </s> remove RangeStart: net.IP{192, 168, 10, 100}, RangeEnd: net.IP{192, 168, 10, 200}, GatewayIP: net.IP{192, 168, 10, 1}, SubnetMask: net.IP{255, 255, 255, 0}, </s> add RangeStart: netip.MustParseAddr("192.168.10.100"), RangeEnd: netip.MustParseAddr("192.168.10.200"), GatewayIP: netip.MustParseAddr("192.168.10.1"), SubnetMask: netip.MustParseAddr("255.255.255.0"), </s> remove DefaultRangeStart = net.IP{192, 168, 10, 100} DefaultRangeEnd = net.IP{192, 168, 10, 200} DefaultGatewayIP = net.IP{192, 168, 10, 1} DefaultSelfIP = net.IP{192, 168, 10, 2} DefaultSubnetMask = net.IP{255, 255, 255, 0} </s> add DefaultRangeStart = netip.MustParseAddr("192.168.10.100") DefaultRangeEnd = netip.MustParseAddr("192.168.10.200") DefaultGatewayIP = netip.MustParseAddr("192.168.10.1") DefaultSelfIP = netip.MustParseAddr("192.168.10.2") DefaultSubnetMask = netip.MustParseAddr("255.255.255.0") </s> remove RangeStart: net.IP{192, 168, 10, 20}, RangeEnd: net.IP{192, 168, 10, 200}, </s> add RangeStart: netip.MustParseAddr("192.168.10.20"), RangeEnd: netip.MustParseAddr("192.168.10.200"),
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> t.Run("offer", func(t *testing.T) { <mask> assert.Equal(t, dhcpv4.MessageTypeOffer, resp.MessageType()) <mask> assert.Equal(t, mac, resp.ClientHWAddr) <mask> assert.True(t, l.IP.Equal(resp.YourIPAddr)) <mask> assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) <mask> assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) <mask> assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) <mask> assert.Equal(t, s.conf.leaseTime.Seconds(), resp.IPAddressLeaseTime(-1).Seconds()) <mask> }) <mask> <mask> t.Run("request", func(t *testing.T) { <mask> req, err = dhcpv4.NewRequestFromOffer(resp) </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.Equal(t, s.conf.RangeStart, resp.YourIPAddr) assert.Equal(t, s.conf.GatewayIP, resp.ServerIdentifier()) </s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.Equal(t, s.conf.GatewayIP, router[0]) </s> add assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.True(t, s.conf.RangeStart.Equal(resp.YourIPAddr)) </s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.Equal(t, s.conf.GatewayIP, router[0]) </s> add assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice()))
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> t.Run("ack", func(t *testing.T) { <mask> assert.Equal(t, dhcpv4.MessageTypeAck, resp.MessageType()) <mask> assert.Equal(t, mac, resp.ClientHWAddr) <mask> assert.True(t, l.IP.Equal(resp.YourIPAddr)) <mask> assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) <mask> assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) <mask> assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) <mask> assert.Equal(t, s.conf.leaseTime.Seconds(), resp.IPAddressLeaseTime(-1).Seconds()) <mask> }) <mask> <mask> dnsAddrs := resp.DNS() <mask> require.Len(t, dnsAddrs, 1) </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.True(t, s.conf.RangeStart.Equal(resp.YourIPAddr)) </s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) </s> remove assert.Equal(t, s.conf.GatewayIP, router[0]) </s> add assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.Equal(t, s.conf.RangeStart, resp.YourIPAddr) assert.Equal(t, s.conf.GatewayIP, resp.ServerIdentifier()) </s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.Equal(t, s.conf.GatewayIP, router[0]) </s> add assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice()))
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> dnsAddrs := resp.DNS() <mask> require.Len(t, dnsAddrs, 1) <mask> <mask> assert.True(t, s.conf.GatewayIP.Equal(dnsAddrs[0])) <mask> <mask> t.Run("check_lease", func(t *testing.T) { <mask> ls := s.GetLeases(LeasesStatic) <mask> require.Len(t, ls, 1) <mask> </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.True(t, s.conf.RangeStart.Equal(resp.YourIPAddr)) </s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) </s> remove assert.Equal(t, s.conf.RangeStart, resp.YourIPAddr) assert.Equal(t, s.conf.GatewayIP, resp.ServerIdentifier()) </s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.Equal(t, s.conf.GatewayIP, router[0]) </s> add assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.Equal(t, s.conf.GatewayIP, router[0]) </s> add assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice()))
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> s, err := v4Create(conf) <mask> require.NoError(t, err) <mask> <mask> s.conf.dnsIPAddrs = []net.IP{{192, 168, 10, 1}} <mask> s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs...)) <mask> <mask> var req, resp *dhcpv4.DHCPv4 <mask> mac := net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA} <mask> <mask> t.Run("discover", func(t *testing.T) { </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove s.conf.dnsIPAddrs = []net.IP{{192, 168, 10, 1}} s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs...)) </s> add dnsAddr := netip.MustParseAddr("192.168.10.1") s.conf.dnsIPAddrs = []netip.Addr{dnsAddr} s.implicitOpts.Update(dhcpv4.OptDNS(dnsAddr.AsSlice())) </s> remove IP: DefaultGatewayIP, </s> add IP: DefaultGatewayIP.AsSlice(), </s> remove s.conf.dnsIPAddrs = []net.IP{defaultIP} </s> add s.conf.dnsIPAddrs = []netip.Addr{defaultIP} </s> remove resp := discoverAnOffer(t, staticName, anotherIP, anotherMAC) </s> add resp := discoverAnOffer(t, staticName, anotherIP.AsSlice(), anotherMAC) </s> remove resp := discoverAnOffer(t, anotherName, anotherIP, staticMAC) </s> add resp := discoverAnOffer(t, anotherName, anotherIP.AsSlice(), staticMAC) </s> remove defer func() { s.implicitOpts.Update(dhcpv4.OptDNS(defaultIP)) }() </s> add defer func() { s.implicitOpts.Update(dhcpv4.OptDNS(defaultIP.AsSlice())) }()
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> t.Run("offer", func(t *testing.T) { <mask> assert.Equal(t, dhcpv4.MessageTypeOffer, resp.MessageType()) <mask> assert.Equal(t, mac, resp.ClientHWAddr) <mask> <mask> assert.Equal(t, s.conf.RangeStart, resp.YourIPAddr) <mask> assert.Equal(t, s.conf.GatewayIP, resp.ServerIdentifier()) <mask> <mask> router := resp.Router() <mask> require.Len(t, router, 1) <mask> <mask> assert.Equal(t, s.conf.GatewayIP, router[0]) </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove assert.True(t, s.conf.RangeStart.Equal(resp.YourIPAddr)) </s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) </s> remove assert.Equal(t, s.conf.GatewayIP, router[0]) </s> add assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.Equal(t, s.conf.GatewayIP, router[0]) </s> add assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones)
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep replace keep replace keep keep
<mask> router := resp.Router() <mask> require.Len(t, router, 1) <mask> <mask> assert.Equal(t, s.conf.GatewayIP, router[0]) <mask> <mask> assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) <mask> assert.Equal(t, s.conf.leaseTime.Seconds(), resp.IPAddressLeaseTime(-1).Seconds()) <mask> assert.Equal(t, []byte("012"), resp.Options.Get(dhcpv4.OptionFQDN)) </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove assert.Equal(t, s.conf.GatewayIP, router[0]) </s> add assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.Equal(t, s.conf.RangeStart, resp.YourIPAddr) assert.Equal(t, s.conf.GatewayIP, resp.ServerIdentifier()) </s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.True(t, s.conf.RangeStart.Equal(resp.YourIPAddr)) </s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones)
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> t.Run("ack", func(t *testing.T) { <mask> assert.Equal(t, dhcpv4.MessageTypeAck, resp.MessageType()) <mask> assert.Equal(t, mac, resp.ClientHWAddr) <mask> assert.True(t, s.conf.RangeStart.Equal(resp.YourIPAddr)) <mask> <mask> router := resp.Router() <mask> require.Len(t, router, 1) <mask> <mask> assert.Equal(t, s.conf.GatewayIP, router[0]) </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove assert.Equal(t, s.conf.RangeStart, resp.YourIPAddr) assert.Equal(t, s.conf.GatewayIP, resp.ServerIdentifier()) </s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.Equal(t, s.conf.GatewayIP, router[0]) </s> add assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.Equal(t, s.conf.GatewayIP, router[0]) </s> add assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones)
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep replace keep replace replace keep keep keep keep
<mask> <mask> assert.Equal(t, s.conf.GatewayIP, router[0]) <mask> <mask> assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) <mask> assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) <mask> assert.Equal(t, s.conf.leaseTime.Seconds(), resp.IPAddressLeaseTime(-1).Seconds()) <mask> }) <mask> <mask> dnsAddrs := resp.DNS() </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.Equal(t, s.conf.GatewayIP, router[0]) </s> add assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.Equal(t, s.conf.RangeStart, resp.YourIPAddr) assert.Equal(t, s.conf.GatewayIP, resp.ServerIdentifier()) </s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice()))
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dhcpd/v4_unix_test.go
keep keep keep add keep keep keep keep
<mask> <mask> // accessCtx controls IP and client blocking that takes place before all other <mask> // processing. An accessCtx is safe for concurrent use. <mask> type accessCtx struct { <mask> allowedIPs *netutil.IPMap <mask> blockedIPs *netutil.IPMap <mask> <mask> allowedClientIDs *stringutil.Set </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> add // TODO(e.burkov): Use map[netip.Addr]struct{} instead. </s> add // // TODO(e.burkov): Use map[netip.Addr]struct{} instead. </s> add // // TODO(e.burkov): Use map[netip.Addr]struct{} instead. </s> add // // TODO(e.burkov): Use map[netip.Addr]struct{} instead. </s> remove IP net.IP `json:"ip"` Port int `json:"port"` </s> add IP netip.Addr `json:"ip"` Port int `json:"port"` </s> remove GatewayIP net.IP `yaml:"gateway_ip" json:"gateway_ip"` SubnetMask net.IP `yaml:"subnet_mask" json:"subnet_mask"` </s> add GatewayIP netip.Addr `yaml:"gateway_ip" json:"gateway_ip"` SubnetMask netip.Addr `yaml:"subnet_mask" json:"subnet_mask"`
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dnsforward/access.go
keep keep keep add keep keep keep keep
<mask> <mask> tableHostToIP hostToIPTable <mask> tableHostToIPLock sync.Mutex <mask> <mask> tableIPToHost *netutil.IPMap <mask> tableIPToHostLock sync.Mutex <mask> <mask> // clientIDCache is a temporary storage for ClientIDs that were extracted </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> add // // TODO(e.burkov): Use map[netip.Addr]struct{} instead. </s> add // TODO(e.burkov): Use map[netip.Addr]struct{} instead. </s> add // // TODO(e.burkov): Use map[netip.Addr]struct{} instead. </s> add // // TODO(e.burkov): Use map[netip.Addr]struct{} instead. </s> remove if !s.conf.subnet.Contains(reqIP) { </s> add if !s.conf.subnet.Contains(netip.AddrFrom4(*(*[4]byte)(ip4))) { </s> remove func dhcpcdConfIface(ifaceName string, ipNet *net.IPNet, gwIP net.IP) (conf string) { </s> add func dhcpcdConfIface(ifaceName string, subnet netip.Prefix, gateway netip.Addr) (conf string) {
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/dnsforward/dnsforward.go
keep add keep keep keep keep
<mask> <mask> // ipToRC is the IP address to *RuntimeClient map. <mask> ipToRC *netutil.IPMap <mask> <mask> lock sync.Mutex <mask> </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> add // TODO(e.burkov): Use map[netip.Addr]struct{} instead. </s> add // // TODO(e.burkov): Use map[netip.Addr]struct{} instead. </s> remove broadcastIP net.IP </s> add broadcastIP netip.Addr </s> add // TODO(e.burkov): Use map[netip.Addr]struct{} instead. </s> add // // TODO(e.burkov): Use map[netip.Addr]struct{} instead. </s> remove RangeStart net.IP `yaml:"range_start" json:"range_start"` RangeEnd net.IP `yaml:"range_end" json:"range_end"` </s> add RangeStart netip.Addr `yaml:"range_start" json:"range_start"` RangeEnd netip.Addr `yaml:"range_end" json:"range_end"`
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/clients.go
keep keep add keep keep keep keep keep keep
<mask> <mask> import ( <mask> "net" <mask> "os" <mask> "runtime" <mask> "testing" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> add "net/netip" </s> remove "net" </s> add </s> remove "net" </s> add </s> remove "net" </s> add "net/netip" </s> add "net/netip" </s> remove "net" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/clients_test.go
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> Enabled: true, <mask> DBFilePath: "leases.db", <mask> Conf4: dhcpd.V4ServerConf{ <mask> Enabled: true, <mask> GatewayIP: net.IP{1, 2, 3, 1}, <mask> SubnetMask: net.IP{255, 255, 255, 0}, <mask> RangeStart: net.IP{1, 2, 3, 2}, <mask> RangeEnd: net.IP{1, 2, 3, 10}, <mask> }, <mask> } <mask> <mask> dhcpServer, err := dhcpd.Create(config) <mask> require.NoError(t, err) </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove RangeStart: net.IP{192, 168, 10, 100}, RangeEnd: net.IP{192, 168, 10, 200}, GatewayIP: net.IP{192, 168, 10, 1}, SubnetMask: net.IP{255, 255, 255, 0}, </s> add RangeStart: netip.MustParseAddr("192.168.10.100"), RangeEnd: netip.MustParseAddr("192.168.10.200"), GatewayIP: netip.MustParseAddr("192.168.10.1"), SubnetMask: netip.MustParseAddr("255.255.255.0"), </s> remove RangeStart: net.IP{192, 168, 10, 20}, RangeEnd: net.IP{192, 168, 10, 200}, </s> add RangeStart: netip.MustParseAddr("192.168.10.20"), RangeEnd: netip.MustParseAddr("192.168.10.200"), </s> remove opts: options{bindHost: net.IP{1, 2, 3, 4}}, </s> add </s> remove want net.IP </s> add want netip.Addr name string </s> remove name: "success_v4", </s> add </s> remove want: net.IP{1, 2, 3, 4}.To16(), </s> add want: netip.MustParseAddr("1.2.3.4"), name: "success_v4",
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/clients_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> import ( <mask> "bytes" <mask> "fmt" <mask> "net" <mask> "os" <mask> "path/filepath" <mask> "sync" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghalg" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> add "net/netip" </s> remove "net" </s> add "net/netip" </s> remove "net" </s> add "net/netip" </s> add "net/netip" </s> remove "net" </s> add </s> remove "net" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/config.go
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> // Raw file data to avoid re-reading of configuration file <mask> // It's reset after config is parsed <mask> fileData []byte <mask> <mask> BindHost net.IP `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to <mask> BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server <mask> BetaBindPort int `yaml:"beta_bind_port"` // BetaBindPort is the port for new client <mask> Users []webUser `yaml:"users"` // Users that can access HTTP server <mask> // AuthAttempts is the maximum number of failed login attempts a user <mask> // can do before being blocked. <mask> AuthAttempts uint `yaml:"auth_attempts"` <mask> // AuthBlockMin is the duration, in minutes, of the block of new login <mask> // attempts after AuthAttempts unsuccessful login attempts. </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove AuthBlockMin uint `yaml:"block_auth_min"` ProxyURL string `yaml:"http_proxy"` // Proxy address for our HTTP client Language string `yaml:"language"` // two-letter ISO 639-1 language code DebugPProf bool `yaml:"debug_pprof"` // Enable pprof HTTP server on port 6060 </s> add AuthBlockMin uint `yaml:"block_auth_min"` // ProxyURL is the address of proxy server for the internal HTTP client. ProxyURL string `yaml:"http_proxy"` // Language is a two-letter ISO 639-1 language code. Language string `yaml:"language"` // DebugPProf defines if the profiling HTTP handler will listen on :6060. DebugPProf bool `yaml:"debug_pprof"` </s> remove bindHost net.IP </s> add bindHost netip.Addr </s> remove BindHost net.IP </s> add BindHost netip.Addr </s> remove subnet *net.IPNet </s> add subnet netip.Prefix </s> remove dnsIPAddrs []net.IP // IPv4 addresses to return to DHCP clients as DNS server addresses </s> add dnsIPAddrs []netip.Addr // IPv4 addresses to return to DHCP clients as DNS server addresses </s> remove return aghnet.CheckPort("tcp", req.Web.IP, portInt) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt)))
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/config.go
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> // can do before being blocked. <mask> AuthAttempts uint `yaml:"auth_attempts"` <mask> // AuthBlockMin is the duration, in minutes, of the block of new login <mask> // attempts after AuthAttempts unsuccessful login attempts. <mask> AuthBlockMin uint `yaml:"block_auth_min"` <mask> ProxyURL string `yaml:"http_proxy"` // Proxy address for our HTTP client <mask> Language string `yaml:"language"` // two-letter ISO 639-1 language code <mask> DebugPProf bool `yaml:"debug_pprof"` // Enable pprof HTTP server on port 6060 <mask> <mask> // TTL for a web session (in hours) <mask> // An active session is automatically refreshed once a day. <mask> WebSessionTTLHours uint32 `yaml:"web_session_ttl"` <mask> </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove BindHost net.IP `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server BetaBindPort int `yaml:"beta_bind_port"` // BetaBindPort is the port for new client Users []webUser `yaml:"users"` // Users that can access HTTP server </s> add // BindHost is the address for the web interface server to listen on. BindHost netip.Addr `yaml:"bind_host"` // BindPort is the port for the web interface server to listen on. BindPort int `yaml:"bind_port"` // BetaBindPort is the port for the new client's web interface server to // listen on. BetaBindPort int `yaml:"beta_bind_port"` // Users are the clients capable for accessing the web interface. Users []webUser `yaml:"users"` </s> remove bindHost net.IP </s> add bindHost netip.Addr </s> remove QueryLogEnabled bool `yaml:"querylog_enabled"` // if true, query log is enabled QueryLogFileEnabled bool `yaml:"querylog_file_enabled"` // if true, query log will be written to a file </s> add // QueryLogEnabled defines if the query log is enabled. QueryLogEnabled bool `yaml:"querylog_enabled"` // QueryLogFileEnabled defines, if the query log is written to the file. QueryLogFileEnabled bool `yaml:"querylog_file_enabled"` </s> remove QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` // QueryLogMemSize is the number of entries kept in memory before they are // flushed to disk. QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // AnonymizeClientIP defines if clients' IP addresses should be anonymized // in query log and statistics. AnonymizeClientIP bool `yaml:"anonymize_client_ip"` </s> remove // time interval for statistics (in days) </s> add // StatsInterval is the time interval for flushing statistics to the disk in // days. </s> remove if !s.conf.subnet.Contains(reqIP) { </s> add if !s.conf.subnet.Contains(netip.AddrFrom4(*(*[4]byte)(ip4))) {
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/config.go
keep keep keep keep replace keep keep keep keep keep
<mask> // cloned from the filtering module back here. <mask> // <mask> // TODO(e.burkov): Move all the filtering configuration fields into the <mask> // only configuration subsection covering the changes with a single <mask> // migration. <mask> Filters []filtering.FilterYAML `yaml:"filters"` <mask> WhitelistFilters []filtering.FilterYAML `yaml:"whitelist_filters"` <mask> UserRules []string `yaml:"user_rules"` <mask> <mask> DHCP *dhcpd.ServerConfig `yaml:"dhcp"` </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove "github.com/AdguardTeam/golibs/netutil" </s> add </s> remove config.DNS.BindHosts = []net.IP{req.DNS.IP} </s> add config.DNS.BindHosts = []netip.Addr{req.DNS.IP} </s> remove defaultIP := net.IP{192, 168, 1, 1} </s> add defaultIP := netip.MustParseAddr("192.168.1.1") </s> remove return aghnet.CheckPort("tcp", req.Web.IP, portInt) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> remove dnsIPAddrs []net.IP // IPv4 addresses to return to DHCP clients as DNS server addresses </s> add dnsIPAddrs []netip.Addr // IPv4 addresses to return to DHCP clients as DNS server addresses </s> remove func dhcpcdConfIface(ifaceName string, ipNet *net.IPNet, gwIP net.IP) (conf string) { </s> add func dhcpcdConfIface(ifaceName string, subnet netip.Prefix, gateway netip.Addr) (conf string) {
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/config.go
keep keep replace replace keep replace keep keep
<mask> // field ordering is important -- yaml fields will mirror ordering from here <mask> type dnsConfig struct { <mask> BindHosts []net.IP `yaml:"bind_hosts"` <mask> Port int `yaml:"port"` <mask> <mask> // time interval for statistics (in days) <mask> StatsInterval uint32 `yaml:"statistics_interval"` <mask> </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove QueryLogEnabled bool `yaml:"querylog_enabled"` // if true, query log is enabled QueryLogFileEnabled bool `yaml:"querylog_file_enabled"` // if true, query log will be written to a file </s> add // QueryLogEnabled defines if the query log is enabled. QueryLogEnabled bool `yaml:"querylog_enabled"` // QueryLogFileEnabled defines, if the query log is written to the file. QueryLogFileEnabled bool `yaml:"querylog_file_enabled"` </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> remove IP net.IP `json:"ip"` Port int `json:"port"` </s> add IP netip.Addr `json:"ip"` Port int `json:"port"` </s> remove IP net.IP `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> add IP netip.Addr `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"`
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/config.go
keep keep keep replace replace keep keep keep keep keep keep keep keep replace replace replace keep keep keep keep
<mask> // time interval for statistics (in days) <mask> StatsInterval uint32 `yaml:"statistics_interval"` <mask> <mask> QueryLogEnabled bool `yaml:"querylog_enabled"` // if true, query log is enabled <mask> QueryLogFileEnabled bool `yaml:"querylog_file_enabled"` // if true, query log will be written to a file <mask> // QueryLogInterval is the interval for query log's files rotation. <mask> QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` <mask> QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk <mask> AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats <mask> <mask> QueryLogEnabled bool `yaml:"querylog_enabled"` // if true, query log is enabled <mask> QueryLogFileEnabled bool `yaml:"querylog_file_enabled"` // if true, query log will be written to a file <mask> // QueryLogInterval is the interval for query log's files rotation. <mask> QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` <mask> QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk <mask> AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats <mask> <mask> dnsforward.FilteringConfig `yaml:",inline"` <mask> <mask> DnsfilterConf *filtering.Config `yaml:",inline"` </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove // time interval for statistics (in days) </s> add // StatsInterval is the time interval for flushing statistics to the disk in // days. </s> remove BindHosts []net.IP `yaml:"bind_hosts"` Port int `yaml:"port"` </s> add BindHosts []netip.Addr `yaml:"bind_hosts"` Port int `yaml:"port"` </s> remove AuthBlockMin uint `yaml:"block_auth_min"` ProxyURL string `yaml:"http_proxy"` // Proxy address for our HTTP client Language string `yaml:"language"` // two-letter ISO 639-1 language code DebugPProf bool `yaml:"debug_pprof"` // Enable pprof HTTP server on port 6060 </s> add AuthBlockMin uint `yaml:"block_auth_min"` // ProxyURL is the address of proxy server for the internal HTTP client. ProxyURL string `yaml:"http_proxy"` // Language is a two-letter ISO 639-1 language code. Language string `yaml:"language"` // DebugPProf defines if the profiling HTTP handler will listen on :6060. DebugPProf bool `yaml:"debug_pprof"` </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> remove BindHost net.IP `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server BetaBindPort int `yaml:"beta_bind_port"` // BetaBindPort is the port for new client Users []webUser `yaml:"users"` // Users that can access HTTP server </s> add // BindHost is the address for the web interface server to listen on. BindHost netip.Addr `yaml:"bind_host"` // BindPort is the port for the web interface server to listen on. BindPort int `yaml:"bind_port"` // BetaBindPort is the port for the new client's web interface server to // listen on. BetaBindPort int `yaml:"beta_bind_port"` // Users are the clients capable for accessing the web interface. Users []webUser `yaml:"users"`
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/config.go
keep replace keep keep keep keep replace keep keep keep
<mask> BetaBindPort: 0, <mask> BindHost: net.IP{0, 0, 0, 0}, <mask> AuthAttempts: 5, <mask> AuthBlockMin: 15, <mask> WebSessionTTLHours: 30 * 24, <mask> DNS: dnsConfig{ <mask> BindHosts: []net.IP{{0, 0, 0, 0}}, <mask> Port: defaultPortDNS, <mask> StatsInterval: 1, <mask> QueryLogEnabled: true, </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove subnet: &net.IPNet{ IP: net.IP{192, 168, 1, 2}, }, want: net.IP{192, 168, 1, 255}, </s> add </s> remove BindHosts: []net.IP{netutil.IPv4Zero()}, </s> add BindHosts: []netip.Addr{netip.IPv4Unspecified()}, </s> remove subnet: &net.IPNet{ IP: net.IP{0, 0, 0, 0}, Mask: net.IPMask{0, 0, 0, 0}, }, want: net.IPv4bcast, </s> add }, { pref: netip.Prefix{}, want: netip.Addr{}, name: "invalid", </s> remove err := CheckPort("udp", net.IP{0, 0, 0, 0}, 0) </s> add err := CheckPort("udp", netip.AddrPortFrom(netip.IPv4Unspecified(), 0)) </s> remove ip4, ip6 := net.IP{1, 2, 3, 4}, net.IP{0xAA, 0xAA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1} mask4, mask6 := net.CIDRMask(24, netutil.IPv4BitLen), net.CIDRMask(8, netutil.IPv6BitLen) </s> add ip4, ok := netip.AddrFromSlice([]byte{1, 2, 3, 4}) require.True(t, ok) ip6, ok := netip.AddrFromSlice([]byte{0xAA, 0xAA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}) require.True(t, ok) net4 := netip.PrefixFrom(ip4, 24) net6 := netip.PrefixFrom(ip6, 8)
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/config.go
keep keep keep keep replace keep keep keep keep keep
<mask> package home <mask> <mask> import ( <mask> "fmt" <mask> "net" <mask> "net/http" <mask> "net/url" <mask> "runtime" <mask> "strings" <mask> "time" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove "net" </s> add "net/netip" </s> add "net/netip" </s> remove "net" </s> add "net/netip" </s> add "net/netip" </s> add "net/netip" </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/control.go
keep add keep keep keep keep
<mask> "fmt" <mask> "net/http" <mask> "net/url" <mask> "runtime" <mask> "strings" <mask> "time" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove "net" </s> add </s> add "net/netip" </s> add "net/netip" </s> add "net/netip" </s> remove "net" </s> add </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/control.go
keep keep keep keep replace keep keep keep replace keep keep keep
<mask> ) <mask> <mask> // appendDNSAddrs is a convenient helper for appending a formatted form of DNS <mask> // addresses to a slice of strings. <mask> func appendDNSAddrs(dst []string, addrs ...net.IP) (res []string) { <mask> for _, addr := range addrs { <mask> var hostport string <mask> if config.DNS.Port != defaultPortDNS { <mask> hostport = netutil.JoinHostPort(addr.String(), config.DNS.Port) <mask> } else { <mask> hostport = addr.String() <mask> } </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove func appendDNSAddrsWithIfaces(dst []string, src []net.IP) (res []string, err error) { </s> add func appendDNSAddrsWithIfaces(dst []string, src []netip.Addr) (res []string, err error) { </s> remove addrs = appendDNSAddrs(addrs, net.IP{127, 0, 0, 1}) </s> add addr := aghnet.IPv4Localhost() addrs = appendDNSAddrs(addrs, addr) </s> remove return nil, err </s> add return netip.Prefix{}, err </s> add var ip net.IP var maskLen int </s> remove for _, iface := range ifaces { var addrs []net.Addr addrs, err = iface.Addrs() if err != nil { return nil, fmt.Errorf("failed to get addresses for interface %s: %w", iface.Name, err) </s> add // Collect network interface addresses. for _, addr := range addrs { n, ok := addr.(*net.IPNet) if !ok { // Should be *net.IPNet, this is weird. return nil, fmt.Errorf("expected %[2]s to be %[1]T, got %[2]T", n, addr) } else if ip4 := n.IP.To4(); ip4 != nil { n.IP = ip4
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/control.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> // appendDNSAddrsWithIfaces formats and appends all DNS addresses from src to <mask> // dst. It also adds the IP addresses of all network interfaces if src contains <mask> // an unspecified IP address. <mask> func appendDNSAddrsWithIfaces(dst []string, src []net.IP) (res []string, err error) { <mask> ifacesAdded := false <mask> for _, h := range src { <mask> if !h.IsUnspecified() { <mask> dst = appendDNSAddrs(dst, h) <mask> </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove addrs = appendDNSAddrs(addrs, net.IP{127, 0, 0, 1}) </s> add addr := aghnet.IPv4Localhost() addrs = appendDNSAddrs(addrs, addr) </s> remove func appendDNSAddrs(dst []string, addrs ...net.IP) (res []string) { </s> add func appendDNSAddrs(dst []string, addrs ...netip.Addr) (res []string) { </s> remove hostport = netutil.JoinHostPort(addr.String(), config.DNS.Port) </s> add hostport = netip.AddrPortFrom(addr, uint16(config.DNS.Port)).String() </s> remove dnsIPAddrs []net.IP // IPv4 addresses to return to DHCP clients as DNS server addresses </s> add dnsIPAddrs []netip.Addr // IPv4 addresses to return to DHCP clients as DNS server addresses </s> remove subnet *net.IPNet </s> add subnet netip.Prefix </s> remove // GetValidNetInterfacesForWeb returns interfaces that are eligible for DNS and // WEB only we do not return link-local addresses here. // // TODO(e.burkov): Can't properly test the function since it's nontrivial to // substitute net.Interface.Addrs and the net.InterfaceAddrs can't be used. func GetValidNetInterfacesForWeb() (netIfaces []*NetInterface, err error) { ifaces, err := net.Interfaces() </s> add func NetInterfaceFrom(iface *net.Interface) (niface *NetInterface, err error) { niface = &NetInterface{ Name: iface.Name, HardwareAddr: iface.HardwareAddr, Flags: iface.Flags, MTU: iface.MTU, } addrs, err := iface.Addrs()
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/control.go
keep keep keep keep replace keep keep keep keep keep
<mask> // collectDNSAddresses returns the list of DNS addresses the server is listening <mask> // on, including the addresses on all interfaces in cases of unspecified IPs. <mask> func collectDNSAddresses() (addrs []string, err error) { <mask> if hosts := config.DNS.BindHosts; len(hosts) == 0 { <mask> addrs = appendDNSAddrs(addrs, net.IP{127, 0, 0, 1}) <mask> } else { <mask> addrs, err = appendDNSAddrsWithIfaces(addrs, hosts) <mask> if err != nil { <mask> return nil, fmt.Errorf("collecting dns addresses: %w", err) <mask> } </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove func appendDNSAddrsWithIfaces(dst []string, src []net.IP) (res []string, err error) { </s> add func appendDNSAddrsWithIfaces(dst []string, src []netip.Addr) (res []string, err error) { </s> remove return nil, fmt.Errorf("couldn't get interfaces: %w", err) } else if len(ifaces) == 0 { return nil, errors.Error("couldn't find any legible interface") </s> add return nil, fmt.Errorf("failed to get addresses for interface %s: %w", iface.Name, err) </s> remove // GetValidNetInterfacesForWeb returns interfaces that are eligible for DNS and // WEB only we do not return link-local addresses here. // // TODO(e.burkov): Can't properly test the function since it's nontrivial to // substitute net.Interface.Addrs and the net.InterfaceAddrs can't be used. func GetValidNetInterfacesForWeb() (netIfaces []*NetInterface, err error) { ifaces, err := net.Interfaces() </s> add func NetInterfaceFrom(iface *net.Interface) (niface *NetInterface, err error) { niface = &NetInterface{ Name: iface.Name, HardwareAddr: iface.HardwareAddr, Flags: iface.Flags, MTU: iface.MTU, } addrs, err := iface.Addrs() </s> remove hosts = []net.IP{{127, 0, 0, 1}} </s> add hosts = []netip.Addr{aghnet.IPv4Localhost()} </s> remove // Discard interfaces with no addresses. if len(netIface.Addresses) != 0 { netIfaces = append(netIfaces, netIface) </s> add ones, _ := n.Mask.Size() p := netip.PrefixFrom(ip, ones) niface.Addresses = append(niface.Addresses, ip) niface.Subnets = append(niface.Subnets, p) } return niface, nil } // GetValidNetInterfacesForWeb returns interfaces that are eligible for DNS and // WEB only we do not return link-local addresses here. // // TODO(e.burkov): Can't properly test the function since it's nontrivial to // substitute net.Interface.Addrs and the net.InterfaceAddrs can't be used. func GetValidNetInterfacesForWeb() (nifaces []*NetInterface, err error) { ifaces, err := net.Interfaces() if err != nil { return nil, fmt.Errorf("getting interfaces: %w", err) } else if len(ifaces) == 0 { return nil, errors.Error("no legible interfaces") } for i := range ifaces { var niface *NetInterface niface, err = NetInterfaceFrom(&ifaces[i]) if err != nil { return nil, err } else if len(niface.Addresses) != 0 { // Discard interfaces with no addresses. nifaces = append(nifaces, niface) </s> remove func appendDNSAddrs(dst []string, addrs ...net.IP) (res []string) { </s> add func appendDNSAddrs(dst []string, addrs ...netip.Addr) (res []string) {
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/control.go
keep keep keep keep replace keep keep keep keep keep
<mask> "context" <mask> "encoding/json" <mask> "fmt" <mask> "io" <mask> "net" <mask> "net/http" <mask> "os" <mask> "os/exec" <mask> "path/filepath" <mask> "runtime" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> add "net/netip" </s> add "net/netip" </s> add "net/netip" </s> add "net/netip" </s> remove "net" </s> add "net/netip" </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep add keep keep keep keep
<mask> "encoding/json" <mask> "fmt" <mask> "io" <mask> "net/http" <mask> "os" <mask> "os/exec" <mask> "path/filepath" <mask> "runtime" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove "net" </s> add </s> add "net/netip" </s> add "net/netip" </s> add "net/netip" </s> add "net/netip" </s> remove "net" </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> _ = aghhttp.WriteJSONResponse(w, r, data) <mask> } <mask> <mask> type checkConfReqEnt struct { <mask> IP net.IP `json:"ip"` <mask> Port int `json:"port"` <mask> Autofix bool `json:"autofix"` <mask> } <mask> <mask> type checkConfReq struct { <mask> Web checkConfReqEnt `json:"web"` <mask> DNS checkConfReqEnt `json:"dns"` </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove IP net.IP `json:"ip"` Port int `json:"port"` </s> add IP netip.Addr `json:"ip"` Port int `json:"port"` </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` </s> remove BindHosts []net.IP `yaml:"bind_hosts"` Port int `yaml:"port"` </s> add BindHosts []netip.Addr `yaml:"bind_hosts"` Port int `yaml:"port"` </s> remove BindHost net.IP </s> add BindHost netip.Addr </s> remove GatewayIP net.IP `yaml:"gateway_ip" json:"gateway_ip"` SubnetMask net.IP `yaml:"subnet_mask" json:"subnet_mask"` </s> add GatewayIP netip.Addr `yaml:"gateway_ip" json:"gateway_ip"` SubnetMask netip.Addr `yaml:"subnet_mask" json:"subnet_mask"`
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep keep replace keep keep keep keep keep
<mask> // Go on and check the port binding only if it's not zero or won't be <mask> // unbound after install. <mask> } <mask> <mask> return aghnet.CheckPort("tcp", req.Web.IP, portInt) <mask> } <mask> <mask> // validateDNS returns error if the DNS part of the initial configuration can't <mask> // be set. canAutofix is true if the port can be unbound by AdGuard Home <mask> // automatically. </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove err := aghnet.CheckPort("tcp", net.IP{127, 0, 0, 1}, defaultPortDNS) </s> add err := aghnet.CheckPort("tcp", netip.AddrPortFrom(aghnet.IPv4Localhost(), defaultPortDNS)) </s> remove bindHost net.IP </s> add bindHost netip.Addr </s> remove return nil </s> add return p </s> remove // GetSubnet returns pointer to net.IPNet for the specified interface or nil if </s> add // GetSubnet returns the subnet corresponding to the interface of zero prefix if </s> remove BindHost net.IP `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server BetaBindPort int `yaml:"beta_bind_port"` // BetaBindPort is the port for new client Users []webUser `yaml:"users"` // Users that can access HTTP server </s> add // BindHost is the address for the web interface server to listen on. BindHost netip.Addr `yaml:"bind_host"` // BindPort is the port for the web interface server to listen on. BindPort int `yaml:"bind_port"` // BetaBindPort is the port for the new client's web interface server to // listen on. BetaBindPort int `yaml:"beta_bind_port"` // Users are the clients capable for accessing the web interface. Users []webUser `yaml:"users"` </s> remove config.DNS.BindHosts = []net.IP{req.DNS.IP} </s> add config.DNS.BindHosts = []netip.Addr{req.DNS.IP}
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep keep replace keep keep keep keep keep
<mask> if err = tcpPorts.Validate(); err != nil { <mask> return false, err <mask> } <mask> <mask> err = aghnet.CheckPort("tcp", req.DNS.IP, port) <mask> if err != nil { <mask> return false, err <mask> } <mask> } <mask> </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove err = aghnet.CheckPort("udp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) </s> remove err = aghnet.CheckPort("tcp", req.Web.IP, req.Web.Port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(req.Web.Port))) </s> remove restartHTTP = !config.BindHost.Equal(req.Web.IP) || config.BindPort != req.Web.Port </s> add restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> remove err = aghnet.CheckPort("tcp", req.DNS.IP, req.DNS.Port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.DNS.IP, uint16(req.DNS.Port))) </s> remove err = aghnet.CheckPort("udp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) </s> remove dst := netutil.IPPort{ IP: BroadcastFromIPNet(subnet), Port: 67, }.String() </s> add dst := netip.AddrPortFrom(BroadcastFromPref(subnet), 67).String()
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep keep replace keep keep keep keep keep
<mask> return false, err <mask> } <mask> } <mask> <mask> err = aghnet.CheckPort("udp", req.DNS.IP, port) <mask> if !aghnet.IsAddrInUse(err) { <mask> return false, err <mask> } <mask> <mask> // Try to fix automatically. </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove err = aghnet.CheckPort("tcp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) </s> remove err = aghnet.CheckPort("udp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) </s> remove err = aghnet.CheckPort("udp", req.DNS.IP, req.DNS.Port) </s> add err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(req.DNS.Port))) </s> remove dst := netutil.IPPort{ IP: BroadcastFromIPNet(subnet), Port: 67, }.String() </s> add dst := netip.AddrPortFrom(BroadcastFromPref(subnet), 67).String() </s> remove restartHTTP = !config.BindHost.Equal(req.Web.IP) || config.BindPort != req.Web.Port </s> add restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> remove err = aghnet.CheckPort("tcp", req.Web.IP, req.Web.Port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(req.Web.Port)))
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep keep replace keep keep keep keep keep
<mask> if derr := disableDNSStubListener(); derr != nil { <mask> log.Error("disabling DNSStubListener: %s", err) <mask> } <mask> <mask> err = aghnet.CheckPort("udp", req.DNS.IP, port) <mask> canAutofix = false <mask> } <mask> <mask> return canAutofix, err <mask> } </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove err = aghnet.CheckPort("udp", req.DNS.IP, req.DNS.Port) </s> add err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(req.DNS.Port))) </s> remove err = aghnet.CheckPort("udp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) </s> remove err = aghnet.CheckPort("tcp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) </s> remove err = aghnet.CheckPort("tcp", req.DNS.IP, req.DNS.Port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.DNS.IP, uint16(req.DNS.Port))) </s> remove v4conf.Enabled = s.conf.Enabled && len(v4conf.RangeStart) != 0 </s> add v4conf.Enabled = s.conf.Enabled && v4conf.RangeStart.IsValid() </s> remove return nil </s> add return netip.Addr{}
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> // handleStaticIP - handles static IP request <mask> // It either checks if we have a static IP <mask> // Or if set=true, it tries to set it <mask> func handleStaticIP(ip net.IP, set bool) staticIPJSON { <mask> resp := staticIPJSON{} <mask> <mask> interfaceName := aghnet.InterfaceByIP(ip) <mask> resp.Static = "no" <mask> </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> add // IPv4Localhost returns 127.0.0.1, which returns true for [netip.Addr.Is4]. func IPv4Localhost() (ip netip.Addr) { return netip.AddrFrom4([4]byte{127, 0, 0, 1}) } // IPv6Localhost returns ::1, which returns true for [netip.Addr.Is6]. func IPv6Localhost() (ip netip.Addr) { return netip.AddrFrom16([16]byte{15: 1}) } </s> remove func dhcpcdConfIface(ifaceName string, ipNet *net.IPNet, gwIP net.IP) (conf string) { </s> add func dhcpcdConfIface(ifaceName string, subnet netip.Prefix, gateway netip.Addr) (conf string) { </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` </s> remove func appendDNSAddrsWithIfaces(dst []string, src []net.IP) (res []string, err error) { </s> add func appendDNSAddrsWithIfaces(dst []string, src []netip.Addr) (res []string, err error) { </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> remove IP: DefaultGatewayIP, </s> add IP: DefaultGatewayIP.AsSlice(),
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> return nil <mask> } <mask> <mask> type applyConfigReqEnt struct { <mask> IP net.IP `json:"ip"` <mask> Port int `json:"port"` <mask> } <mask> <mask> type applyConfigReq struct { <mask> Username string `json:"username"` <mask> Password string `json:"password"` </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove IP net.IP `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> add IP netip.Addr `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> remove Name string `json:"name"` HardwareAddr string `json:"hardware_address"` Flags string `json:"flags"` GatewayIP net.IP `json:"gateway_ip"` Addrs4 []net.IP `json:"ipv4_addresses"` Addrs6 []net.IP `json:"ipv6_addresses"` </s> add Name string `json:"name"` HardwareAddr string `json:"hardware_address"` Flags string `json:"flags"` GatewayIP netip.Addr `json:"gateway_ip"` Addrs4 []netip.Addr `json:"ipv4_addresses"` Addrs6 []netip.Addr `json:"ipv6_addresses"` </s> remove BindHost net.IP </s> add BindHost netip.Addr </s> remove Subnets []*net.IPNet `json:"-"` </s> add Subnets []netip.Prefix `json:"-"`
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> return <mask> } <mask> <mask> err = aghnet.CheckPort("udp", req.DNS.IP, req.DNS.Port) <mask> if err != nil { <mask> aghhttp.Error(r, w, http.StatusBadRequest, "%s", err) <mask> <mask> return <mask> } </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove err = aghnet.CheckPort("tcp", req.DNS.IP, req.DNS.Port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.DNS.IP, uint16(req.DNS.Port))) </s> remove err = aghnet.CheckPort("udp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) </s> remove err = aghnet.CheckPort("udp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) </s> remove err = aghnet.CheckPort("tcp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) </s> remove return nil </s> add return netip.Addr{} </s> remove v4conf.Enabled = s.conf.Enabled && len(v4conf.RangeStart) != 0 </s> add v4conf.Enabled = s.conf.Enabled && v4conf.RangeStart.IsValid()
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> return <mask> } <mask> <mask> err = aghnet.CheckPort("tcp", req.DNS.IP, req.DNS.Port) <mask> if err != nil { <mask> aghhttp.Error(r, w, http.StatusBadRequest, "%s", err) <mask> <mask> return <mask> } </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove err = aghnet.CheckPort("udp", req.DNS.IP, req.DNS.Port) </s> add err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(req.DNS.Port))) </s> remove err = aghnet.CheckPort("tcp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) </s> remove err = aghnet.CheckPort("udp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) </s> remove err = aghnet.CheckPort("tcp", req.Web.IP, req.Web.Port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(req.Web.Port))) </s> remove restartHTTP = !config.BindHost.Equal(req.Web.IP) || config.BindPort != req.Web.Port </s> add restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> remove err = aghnet.CheckPort("udp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(port)))
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> Context.firstRun = false <mask> config.BindHost = req.Web.IP <mask> config.BindPort = req.Web.Port <mask> config.DNS.BindHosts = []net.IP{req.DNS.IP} <mask> config.DNS.Port = req.DNS.Port <mask> <mask> // TODO(e.burkov): StartMods() should be put in a separate goroutine at the <mask> // moment we'll allow setting up TLS in the initial configuration or the <mask> // configuration itself will use HTTPS protocol, because the underlying </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove restartHTTP = !config.BindHost.Equal(req.Web.IP) || config.BindPort != req.Web.Port </s> add restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> remove // migration. </s> add // migration. Also keep the blocked services in mind. </s> remove return aghnet.CheckPort("tcp", req.Web.IP, portInt) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` </s> remove DefaultRangeStart = net.IP{192, 168, 10, 100} DefaultRangeEnd = net.IP{192, 168, 10, 200} DefaultGatewayIP = net.IP{192, 168, 10, 1} DefaultSelfIP = net.IP{192, 168, 10, 2} DefaultSubnetMask = net.IP{255, 255, 255, 0} </s> add DefaultRangeStart = netip.MustParseAddr("192.168.10.100") DefaultRangeEnd = netip.MustParseAddr("192.168.10.200") DefaultGatewayIP = netip.MustParseAddr("192.168.10.1") DefaultSelfIP = netip.MustParseAddr("192.168.10.2") DefaultSubnetMask = netip.MustParseAddr("255.255.255.0") </s> remove defaultIP := net.IP{192, 168, 1, 1} </s> add defaultIP := netip.MustParseAddr("192.168.1.1")
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep replace keep replace keep keep
<mask> <mask> restartHTTP = !config.BindHost.Equal(req.Web.IP) || config.BindPort != req.Web.Port <mask> if restartHTTP { <mask> err = aghnet.CheckPort("tcp", req.Web.IP, req.Web.Port) <mask> if err != nil { <mask> return nil, false, fmt.Errorf( </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove err = aghnet.CheckPort("tcp", req.DNS.IP, port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) </s> remove err = aghnet.CheckPort("tcp", req.DNS.IP, req.DNS.Port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.DNS.IP, uint16(req.DNS.Port))) </s> remove return net.ParseIP(string(fields[2])) </s> add ip, err = netip.ParseAddr(string(fields[2])) if err != nil { return netip.Addr{} } return ip </s> remove if opts.bindHost != nil { </s> add if opts.bindHost.IsValid() { </s> remove v4conf.Enabled = s.conf.Enabled && len(v4conf.RangeStart) != 0 </s> add v4conf.Enabled = s.conf.Enabled && v4conf.RangeStart.IsValid()
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> // <mask> // TODO(e.burkov): This should removed with the API v1 when the appropriate <mask> // functionality will appear in default checkConfigReqEnt. <mask> type checkConfigReqEntBeta struct { <mask> IP []net.IP `json:"ip"` <mask> Port int `json:"port"` <mask> Autofix bool `json:"autofix"` <mask> } <mask> <mask> // checkConfigReqBeta is a struct representing new client's config check request <mask> // body. It uses checkConfigReqEntBeta instead of checkConfigReqEnt. <mask> // </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` </s> remove IP net.IP `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> add IP netip.Addr `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> remove IP net.IP `json:"ip"` Port int `json:"port"` </s> add IP netip.Addr `json:"ip"` Port int `json:"port"` </s> remove // time interval for statistics (in days) </s> add // StatsInterval is the time interval for flushing statistics to the disk in // days. </s> remove BindHosts []net.IP `yaml:"bind_hosts"` Port int `yaml:"port"` </s> add BindHosts []netip.Addr `yaml:"bind_hosts"` Port int `yaml:"port"` </s> remove BindHost net.IP `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server BetaBindPort int `yaml:"beta_bind_port"` // BetaBindPort is the port for new client Users []webUser `yaml:"users"` // Users that can access HTTP server </s> add // BindHost is the address for the web interface server to listen on. BindHost netip.Addr `yaml:"bind_host"` // BindPort is the port for the web interface server to listen on. BindPort int `yaml:"bind_port"` // BetaBindPort is the port for the new client's web interface server to // listen on. BetaBindPort int `yaml:"beta_bind_port"` // Users are the clients capable for accessing the web interface. Users []webUser `yaml:"users"`
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> // <mask> // TODO(e.burkov): This should removed with the API v1 when the appropriate <mask> // functionality will appear in default applyConfigReqEnt. <mask> type applyConfigReqEntBeta struct { <mask> IP []net.IP `json:"ip"` <mask> Port int `json:"port"` <mask> } <mask> <mask> // applyConfigReqBeta is a struct representing new client's config setting <mask> // request body. It uses applyConfigReqEntBeta instead of applyConfigReqEnt. <mask> // </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> remove IP net.IP `json:"ip"` Port int `json:"port"` </s> add IP netip.Addr `json:"ip"` Port int `json:"port"` </s> remove IP net.IP `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> add IP netip.Addr `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> remove // time interval for statistics (in days) </s> add // StatsInterval is the time interval for flushing statistics to the disk in // days. </s> remove BindHosts []net.IP `yaml:"bind_hosts"` Port int `yaml:"port"` </s> add BindHosts []netip.Addr `yaml:"bind_hosts"` Port int `yaml:"port"` </s> remove BindHost net.IP </s> add BindHost netip.Addr
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/controlinstall.go
keep keep add keep keep keep keep keep
<mask> import ( <mask> "fmt" <mask> "net" <mask> "net/url" <mask> "os" <mask> "path/filepath" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove "net" </s> add "net/netip" </s> remove "net" </s> add </s> add "net/netip" </s> remove "net" </s> add "net/netip" </s> remove "net" </s> add "net/netip" </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/dns.go
keep keep replace keep keep keep keep replace replace replace replace replace replace keep keep keep
<mask> } <mask> <mask> func ipsToTCPAddrs(ips []net.IP, port int) (tcpAddrs []*net.TCPAddr) { <mask> if ips == nil { <mask> return nil <mask> } <mask> <mask> tcpAddrs = make([]*net.TCPAddr, len(ips)) <mask> for i, ip := range ips { <mask> tcpAddrs[i] = &net.TCPAddr{ <mask> IP: ip, <mask> Port: port, <mask> } <mask> } <mask> <mask> return tcpAddrs </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove udpAddrs = make([]*net.UDPAddr, len(ips)) for i, ip := range ips { udpAddrs[i] = &net.UDPAddr{ IP: ip, Port: port, } </s> add udpAddrs = make([]*net.UDPAddr, 0, len(ips)) for _, ip := range ips { udpAddrs = append(udpAddrs, net.UDPAddrFromAddrPort(netip.AddrPortFrom(ip, uint16(port)))) </s> remove func ipsToUDPAddrs(ips []net.IP, port int) (udpAddrs []*net.UDPAddr) { </s> add func ipsToUDPAddrs(ips []netip.Addr, port int) (udpAddrs []*net.UDPAddr) { </s> remove func CheckPort(network string, ip net.IP, port int) (err error) { </s> add func CheckPort(network string, ipp netip.AddrPort) (err error) { </s> remove addr := netutil.IPPort{IP: ip, Port: port}.String() </s> add addr := ipp.String() </s> remove s.conf.dnsIPAddrs = dnsIPAddrs </s> add for _, ip := range dnsIPAddrs { ip = ip.To4() if ip == nil { continue } s.conf.dnsIPAddrs = append(s.conf.dnsIPAddrs, netip.AddrFrom4(*(*[4]byte)(ip))) }
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/dns.go
keep replace keep keep keep keep replace replace replace replace replace replace keep
<mask> <mask> func ipsToUDPAddrs(ips []net.IP, port int) (udpAddrs []*net.UDPAddr) { <mask> if ips == nil { <mask> return nil <mask> } <mask> <mask> udpAddrs = make([]*net.UDPAddr, len(ips)) <mask> for i, ip := range ips { <mask> udpAddrs[i] = &net.UDPAddr{ <mask> IP: ip, <mask> Port: port, <mask> } <mask> } </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove tcpAddrs = make([]*net.TCPAddr, len(ips)) for i, ip := range ips { tcpAddrs[i] = &net.TCPAddr{ IP: ip, Port: port, } </s> add tcpAddrs = make([]*net.TCPAddr, 0, len(ips)) for _, ip := range ips { tcpAddrs = append(tcpAddrs, net.TCPAddrFromAddrPort(netip.AddrPortFrom(ip, uint16(port)))) </s> remove func ipsToTCPAddrs(ips []net.IP, port int) (tcpAddrs []*net.TCPAddr) { </s> add func ipsToTCPAddrs(ips []netip.Addr, port int) (tcpAddrs []*net.TCPAddr) { </s> remove func CheckPort(network string, ip net.IP, port int) (err error) { </s> add func CheckPort(network string, ipp netip.AddrPort) (err error) { </s> remove addr := netutil.IPPort{IP: ip, Port: port}.String() </s> add addr := ipp.String() </s> remove s.conf.dnsIPAddrs = dnsIPAddrs </s> add for _, ip := range dnsIPAddrs { ip = ip.To4() if ip == nil { continue } s.conf.dnsIPAddrs = append(s.conf.dnsIPAddrs, netip.AddrFrom4(*(*[4]byte)(ip))) }
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> func generateServerConfig() (newConf dnsforward.ServerConfig, err error) { <mask> dnsConf := config.DNS <mask> hosts := dnsConf.BindHosts <mask> if len(hosts) == 0 { <mask> hosts = []net.IP{{127, 0, 0, 1}} <mask> } <mask> <mask> newConf = dnsforward.ServerConfig{ <mask> UDPListenAddrs: ipsToUDPAddrs(hosts, dnsConf.Port), <mask> TCPListenAddrs: ipsToTCPAddrs(hosts, dnsConf.Port), </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove addrs = appendDNSAddrs(addrs, net.IP{127, 0, 0, 1}) </s> add addr := aghnet.IPv4Localhost() addrs = appendDNSAddrs(addrs, addr) </s> remove err := CheckPort("udp", net.IP{0, 0, 0, 0}, 0) </s> add err := CheckPort("udp", netip.AddrPortFrom(netip.IPv4Unspecified(), 0)) </s> remove if len(v4Conf.RangeStart) == 0 { </s> add if !v4Conf.RangeStart.IsValid() { </s> remove func newDNSCrypt(hosts []net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { </s> add func newDNSCrypt(hosts []netip.Addr, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { </s> remove restartHTTP = !config.BindHost.Equal(req.Web.IP) || config.BindPort != req.Web.Port </s> add restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> remove return nil, fmt.Errorf("couldn't get interfaces: %w", err) } else if len(ifaces) == 0 { return nil, errors.Error("couldn't find any legible interface") </s> add return nil, fmt.Errorf("failed to get addresses for interface %s: %w", iface.Name, err)
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> return newConf, nil <mask> } <mask> <mask> func newDNSCrypt(hosts []net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { <mask> if tlsConf.DNSCryptConfigFile == "" { <mask> return dnscc, errors.Error("no dnscrypt_config_file") <mask> } <mask> <mask> f, err := os.Open(tlsConf.DNSCryptConfigFile) </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove return Context.web.httpsServer.server != nil || aghnet.CheckPort("tcp", config.BindHost, port) == nil </s> add if Context.web.httpsServer.server != nil { return true } return aghnet.CheckPort("tcp", netip.AddrPortFrom(config.BindHost, uint16(port))) == nil </s> remove func ipsToUDPAddrs(ips []net.IP, port int) (udpAddrs []*net.UDPAddr) { </s> add func ipsToUDPAddrs(ips []netip.Addr, port int) (udpAddrs []*net.UDPAddr) { </s> remove func ipsToTCPAddrs(ips []net.IP, port int) (tcpAddrs []*net.TCPAddr) { </s> add func ipsToTCPAddrs(ips []netip.Addr, port int) (tcpAddrs []*net.TCPAddr) { </s> remove func ifaceIPv4Subnet(iface *net.Interface) (subnet *net.IPNet, err error) { </s> add func ifaceIPv4Subnet(iface *net.Interface) (subnet netip.Prefix, err error) { </s> remove if ipNet.IP == nil { </s> add if !ipNet.Addr().IsValid() { </s> remove return net.ParseIP(string(fields[2])) </s> add ip, err = netip.ParseAddr(string(fields[2])) if err != nil { return netip.Addr{} } return ip
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/dns.go
keep keep add keep keep keep keep
<mask> "net" <mask> "net/http" <mask> "net/http/pprof" <mask> "net/url" <mask> "os" <mask> "os/signal" <mask> "path/filepath" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> add "net/netip" </s> remove "net" </s> add </s> add "net/netip" </s> remove "net" </s> add </s> remove "net" </s> add "net/netip" </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/home.go
keep keep keep keep replace keep keep keep keep keep
<mask> config.BindPort = opts.bindPort <mask> } <mask> <mask> // override bind host/port from the console <mask> if opts.bindHost != nil { <mask> config.BindHost = opts.bindHost <mask> } <mask> if len(opts.pidFile) != 0 && writePIDFile(opts.pidFile) { <mask> Context.pidFileName = opts.pidFile <mask> } </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove restartHTTP = !config.BindHost.Equal(req.Web.IP) || config.BindPort != req.Web.Port </s> add restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> remove v4conf.Enabled = s.conf.Enabled && len(v4conf.RangeStart) != 0 </s> add v4conf.Enabled = s.conf.Enabled && v4conf.RangeStart.IsValid() </s> remove if ipnet.IP.To4() != nil { jsonIface.Addrs4 = append(jsonIface.Addrs4, ipnet.IP) </s> add if ip4 := ipnet.IP.To4(); ip4 != nil { addr := netip.AddrFrom4(*(*[4]byte)(ip4)) jsonIface.Addrs4 = append(jsonIface.Addrs4, addr) </s> remove err = aghnet.CheckPort("tcp", req.Web.IP, req.Web.Port) </s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(req.Web.Port))) </s> remove jsonIface.Addrs6 = append(jsonIface.Addrs6, ipnet.IP) </s> add addr := netip.AddrFrom16(*(*[16]byte)(ipnet.IP)) jsonIface.Addrs6 = append(jsonIface.Addrs6, addr) </s> remove return net.ParseIP(string(fields[2])) </s> add ip, err = netip.ParseAddr(string(fields[2])) if err != nil { return netip.Addr{} } return ip
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/home.go
keep keep keep keep replace keep keep keep keep keep
<mask> log.Fatal("This is the first launch of AdGuard Home. You must run it as Administrator.") <mask> } <mask> <mask> // We should check if AdGuard Home is able to bind to port 53 <mask> err := aghnet.CheckPort("tcp", net.IP{127, 0, 0, 1}, defaultPortDNS) <mask> if err != nil { <mask> if errors.Is(err, os.ErrPermission) { <mask> log.Fatal(`Permission check failed. <mask> <mask> AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove return aghnet.CheckPort("tcp", req.Web.IP, portInt) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> remove bindHost net.IP </s> add bindHost netip.Addr </s> remove return net.ParseIP(string(fields[2])) </s> add ip, err = netip.ParseAddr(string(fields[2])) if err != nil { return netip.Addr{} } return ip </s> remove BindHost net.IP `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server BetaBindPort int `yaml:"beta_bind_port"` // BetaBindPort is the port for new client Users []webUser `yaml:"users"` // Users that can access HTTP server </s> add // BindHost is the address for the web interface server to listen on. BindHost netip.Addr `yaml:"bind_host"` // BindPort is the port for the web interface server to listen on. BindPort int `yaml:"bind_port"` // BetaBindPort is the port for the new client's web interface server to // listen on. BetaBindPort int `yaml:"beta_bind_port"` // Users are the clients capable for accessing the web interface. Users []webUser `yaml:"users"` </s> remove return nil </s> add return p </s> remove addr := netutil.IPPort{IP: ip, Port: port}.String() </s> add addr := ipp.String()
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/home.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> import ( <mask> "bytes" <mask> "encoding/json" <mask> "net" <mask> "net/http" <mask> "net/http/httptest" <mask> "testing" <mask> <mask> "github.com/AdguardTeam/golibs/netutil" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove "github.com/AdguardTeam/golibs/netutil" </s> add </s> remove "net" </s> add "net/netip" </s> add "net/netip" </s> add "net/netip" </s> remove "net" </s> add "net/netip" </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/mobileconfig_test.go
keep add keep keep keep keep
<mask> "net/http" <mask> "net/http/httptest" <mask> "testing" <mask> <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove "github.com/AdguardTeam/golibs/netutil" </s> add </s> remove "net" </s> add "net/netip" </s> remove "net" </s> add </s> add "net/netip" </s> add "net/netip" </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/mobileconfig_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> "net/http" <mask> "net/http/httptest" <mask> "testing" <mask> <mask> "github.com/AdguardTeam/golibs/netutil" <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> "howett.net/plist" <mask> ) <mask> </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> add "net/netip" </s> remove "net" </s> add </s> remove "net" </s> add "net/netip" </s> remove "github.com/AdguardTeam/golibs/netutil" </s> add </s> remove "github.com/AdguardTeam/golibs/netutil" </s> add </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/mobileconfig_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> }) <mask> <mask> config = &configuration{ <mask> DNS: dnsConfig{ <mask> BindHosts: []net.IP{netutil.IPv4Zero()}, <mask> Port: defaultPortDNS, <mask> }, <mask> } <mask> <mask> Context.tls = &TLSMod{} </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove BindHosts: []net.IP{{0, 0, 0, 0}}, </s> add BindHosts: []netip.Addr{netip.IPv4Unspecified()}, </s> remove BindHost: net.IP{0, 0, 0, 0}, </s> add BindHost: netip.IPv4Unspecified(), </s> remove IP: anotherIP, </s> add IP: anotherIP.AsSlice(), </s> remove IP: anotherIP, </s> add IP: anotherIP.AsSlice(), </s> remove tcpAddrs = make([]*net.TCPAddr, len(ips)) for i, ip := range ips { tcpAddrs[i] = &net.TCPAddr{ IP: ip, Port: port, } </s> add tcpAddrs = make([]*net.TCPAddr, 0, len(ips)) for _, ip := range ips { tcpAddrs = append(tcpAddrs, net.TCPAddrFromAddrPort(netip.AddrPortFrom(ip, uint16(port)))) </s> remove udpAddrs = make([]*net.UDPAddr, len(ips)) for i, ip := range ips { udpAddrs[i] = &net.UDPAddr{ IP: ip, Port: port, } </s> add udpAddrs = make([]*net.UDPAddr, 0, len(ips)) for _, ip := range ips { udpAddrs = append(udpAddrs, net.UDPAddrFromAddrPort(netip.AddrPortFrom(ip, uint16(port))))
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/mobileconfig_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> package home <mask> <mask> import ( <mask> "fmt" <mask> "net" <mask> "os" <mask> "strconv" <mask> "strings" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/version" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove "net" </s> add </s> remove "net" </s> add "net/netip" </s> remove "net" </s> add "net/netip" </s> add "net/netip" </s> add "net/netip" </s> remove "net" </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/options.go
keep keep keep keep replace keep keep keep keep keep
<mask> // [service.ControlAction] and [handleServiceControlAction]. <mask> serviceControlAction string <mask> <mask> // bindHost is the address on which to serve the HTTP UI. <mask> bindHost net.IP <mask> <mask> // bindPort is the port on which to serve the HTTP UI. <mask> bindPort int <mask> <mask> // checkConfig is true if the current invocation is only required to check </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove BindHost net.IP `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server BetaBindPort int `yaml:"beta_bind_port"` // BetaBindPort is the port for new client Users []webUser `yaml:"users"` // Users that can access HTTP server </s> add // BindHost is the address for the web interface server to listen on. BindHost netip.Addr `yaml:"bind_host"` // BindPort is the port for the web interface server to listen on. BindPort int `yaml:"bind_port"` // BetaBindPort is the port for the new client's web interface server to // listen on. BetaBindPort int `yaml:"beta_bind_port"` // Users are the clients capable for accessing the web interface. Users []webUser `yaml:"users"` </s> remove AuthBlockMin uint `yaml:"block_auth_min"` ProxyURL string `yaml:"http_proxy"` // Proxy address for our HTTP client Language string `yaml:"language"` // two-letter ISO 639-1 language code DebugPProf bool `yaml:"debug_pprof"` // Enable pprof HTTP server on port 6060 </s> add AuthBlockMin uint `yaml:"block_auth_min"` // ProxyURL is the address of proxy server for the internal HTTP client. ProxyURL string `yaml:"http_proxy"` // Language is a two-letter ISO 639-1 language code. Language string `yaml:"language"` // DebugPProf defines if the profiling HTTP handler will listen on :6060. DebugPProf bool `yaml:"debug_pprof"` </s> remove return aghnet.CheckPort("tcp", req.Web.IP, portInt) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> remove dnsIPAddrs []net.IP // IPv4 addresses to return to DHCP clients as DNS server addresses </s> add dnsIPAddrs []netip.Addr // IPv4 addresses to return to DHCP clients as DNS server addresses </s> add // IPv4Localhost returns 127.0.0.1, which returns true for [netip.Addr.Is4]. func IPv4Localhost() (ip netip.Addr) { return netip.AddrFrom4([4]byte{127, 0, 0, 1}) } // IPv6Localhost returns ::1, which returns true for [netip.Addr.Is6]. func IPv6Localhost() (ip netip.Addr) { return netip.AddrFrom16([16]byte{15: 1}) } </s> remove if !s.conf.subnet.Contains(reqIP) { </s> add if !s.conf.subnet.Contains(netip.AddrFrom4(*(*[4]byte)(ip4))) {
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/options.go
keep replace replace replace keep keep keep keep replace
<mask> }, { <mask> updateWithValue: func(o options, v string) (options, error) { <mask> o.bindHost = net.ParseIP(v) <mask> return o, nil <mask> }, <mask> updateNoValue: nil, <mask> effect: nil, <mask> serialize: func(o options) (val string, ok bool) { <mask> if o.bindHost == nil { </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove want: nil, </s> add want: netip.Addr{}, name: "bad_output", </s> remove want: nil, </s> add want: netip.Addr{}, name: "err_runcmd", </s> remove if ip4 := reqIP.To4(); ip4 == nil { </s> add ip4 := reqIP.To4() if ip4 == nil { </s> remove for _, iface := range ifaces { var addrs []net.Addr addrs, err = iface.Addrs() if err != nil { return nil, fmt.Errorf("failed to get addresses for interface %s: %w", iface.Name, err) </s> add // Collect network interface addresses. for _, addr := range addrs { n, ok := addr.(*net.IPNet) if !ok { // Should be *net.IPNet, this is weird. return nil, fmt.Errorf("expected %[2]s to be %[1]T, got %[2]T", n, addr) } else if ip4 := n.IP.To4(); ip4 != nil { n.IP = ip4 </s> remove return nil, fmt.Errorf("couldn't get interfaces: %w", err) } else if len(ifaces) == 0 { return nil, errors.Error("couldn't find any legible interface") </s> add return nil, fmt.Errorf("failed to get addresses for interface %s: %w", iface.Name, err)
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/options.go
keep keep keep keep replace keep keep keep keep keep
<mask> package home <mask> <mask> import ( <mask> "fmt" <mask> "net" <mask> "testing" <mask> <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove "net" </s> add </s> remove "net" </s> add "net/netip" </s> add "net/netip" </s> remove "github.com/AdguardTeam/golibs/netutil" </s> add </s> add "net/netip" </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/options_test.go
keep replace replace keep keep replace keep keep keep keep
<mask> func TestParseBindHost(t *testing.T) { <mask> assert.Nil(t, testParseOK(t).bindHost, "empty is not host") <mask> assert.Equal(t, net.IPv4(1, 2, 3, 4), testParseOK(t, "-h", "1.2.3.4").bindHost, "-h is host") <mask> testParseParamMissing(t, "-h") <mask> <mask> assert.Equal(t, net.IPv4(1, 2, 3, 4), testParseOK(t, "--host", "1.2.3.4").bindHost, "--host is host") <mask> testParseParamMissing(t, "--host") <mask> } <mask> <mask> func TestParseBindPort(t *testing.T) { </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove known6 := net.IP{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, } </s> add known4 := netip.MustParseAddr("192.168.0.1") fullBroadcast4 := netip.MustParseAddr("255.255.255.255") known6 := netip.MustParseAddr("102:304:506:708:90a:b0c:d0e:f10") </s> remove bc := BroadcastFromIPNet(tc.subnet) assert.True(t, bc.Equal(tc.want), bc) </s> add assert.Equal(t, tc.want, BroadcastFromPref(tc.pref)) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0])) assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier())) assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask()) </s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice())) assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) ones, _ := resp.SubnetMask().Size() assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove defaultIP := net.IP{192, 168, 1, 1} </s> add defaultIP := netip.MustParseAddr("192.168.1.1") </s> remove GatewayIP: net.IP{1, 2, 3, 1}, SubnetMask: net.IP{255, 255, 255, 0}, RangeStart: net.IP{1, 2, 3, 2}, RangeEnd: net.IP{1, 2, 3, 10}, </s> add GatewayIP: netip.MustParseAddr("1.2.3.1"), SubnetMask: netip.MustParseAddr("255.255.255.0"), RangeStart: netip.MustParseAddr("1.2.3.2"), RangeEnd: netip.MustParseAddr("1.2.3.10"),
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/options_test.go
keep keep add keep keep keep keep keep keep
<mask> opts: options{workDir: "path"}, <mask> }, { <mask> name: "bind_host", <mask> args: []string{"-h", "1.2.3.4"}, <mask> }, { <mask> name: "bind_port", <mask> args: []string{"-p", "666"}, <mask> opts: options{bindPort: 666}, <mask> }, { </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove opts: options{bindHost: net.IP{1, 2, 3, 4}}, </s> add </s> add name: "ipv6_no_mask", </s> remove want: nil, </s> add want: netip.Addr{}, name: "bad_output", </s> add pref: netip.PrefixFrom(known4, netutil.IPv4BitLen), want: known4, </s> add pref: netip.PrefixFrom(netip.IPv4Unspecified(), 0), want: fullBroadcast4, </s> remove name: "ipv6_no_mask", subnet: &net.IPNet{ IP: known6, }, </s> add pref: netip.PrefixFrom(known4, 20), want: netip.MustParseAddr("192.168.15.255"), name: "full", }, { pref: netip.PrefixFrom(known6, netutil.IPv6BitLen),
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/options_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> opts: options{workDir: "path"}, <mask> }, { <mask> name: "bind_host", <mask> args: []string{"-h", "1.2.3.4"}, <mask> opts: options{bindHost: net.IP{1, 2, 3, 4}}, <mask> }, { <mask> name: "bind_port", <mask> args: []string{"-p", "666"}, <mask> opts: options{bindPort: 666}, <mask> }, { </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> add opts: options{bindHost: netip.MustParseAddr("1.2.3.4")}, </s> remove want: net.IP{ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF, }, </s> add want: netip.MustParseAddr("::ffff"), name: "success_v6", </s> remove want net.IP </s> add want netip.Addr name string </s> remove name: "success_v4", </s> add </s> remove want: net.IP{1, 2, 3, 4}.To16(), </s> add want: netip.MustParseAddr("1.2.3.4"), name: "success_v4", </s> add name: "ipv6_no_mask",
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/options_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> import ( <mask> "context" <mask> "crypto/tls" <mask> "io/fs" <mask> "net" <mask> "net/http" <mask> "sync" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> add "net/netip" </s> add "net/netip" </s> remove "net" </s> add </s> remove "net" </s> add "net/netip" </s> add "net/netip" </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/web.go
keep add keep keep keep keep keep keep
<mask> "io/fs" <mask> "net/http" <mask> "sync" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet" <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtls" </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove "net" </s> add </s> add "net/netip" </s> add "net/netip" </s> add "net/netip" </s> add "net/netip" </s> add "net/netip"
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/web.go
keep keep keep keep replace keep keep keep keep keep
<mask> type webConfig struct { <mask> clientFS fs.FS <mask> clientBetaFS fs.FS <mask> <mask> BindHost net.IP <mask> BindPort int <mask> BetaBindPort int <mask> PortHTTPS int <mask> <mask> // ReadTimeout is an option to pass to http.Server for setting an </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove BindHost net.IP `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server BetaBindPort int `yaml:"beta_bind_port"` // BetaBindPort is the port for new client Users []webUser `yaml:"users"` // Users that can access HTTP server </s> add // BindHost is the address for the web interface server to listen on. BindHost netip.Addr `yaml:"bind_host"` // BindPort is the port for the web interface server to listen on. BindPort int `yaml:"bind_port"` // BetaBindPort is the port for the new client's web interface server to // listen on. BetaBindPort int `yaml:"beta_bind_port"` // Users are the clients capable for accessing the web interface. Users []webUser `yaml:"users"` </s> remove IP net.IP `json:"ip"` Port int `json:"port"` </s> add IP netip.Addr `json:"ip"` Port int `json:"port"` </s> remove IP net.IP `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> add IP netip.Addr `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` </s> remove BindHosts []net.IP `yaml:"bind_hosts"` Port int `yaml:"port"` </s> add BindHosts []netip.Addr `yaml:"bind_hosts"` Port int `yaml:"port"` </s> remove IP []net.IP `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"` </s> add IP []netip.Addr `json:"ip"` Port int `json:"port"` Autofix bool `json:"autofix"`
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/web.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> // available, unless the HTTPS server isn't active. <mask> // <mask> // TODO(a.garipov): Adapt for HTTP/3. <mask> func webCheckPortAvailable(port int) (ok bool) { <mask> return Context.web.httpsServer.server != nil || <mask> aghnet.CheckPort("tcp", config.BindHost, port) == nil <mask> } <mask> <mask> // TLSConfigChanged updates the TLS configuration and restarts the HTTPS server <mask> // if necessary. <mask> func (web *Web) TLSConfigChanged(ctx context.Context, tlsConf tlsConfigSettings) { </s> Pull request: Migrate to netip.Addr vol.1 Merge in DNS/adguard-home from 2926-lla-v6 to master Updates #2926. Updates #5035. Squashed commit of the following: commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c Merge: 25c1afc5 893358ea Author: Eugene Burkov <[email protected]> Date: Fri Oct 14 15:14:56 2022 +0300 Merge branch 'master' into 2926-lla-v6 commit 25c1afc5f0a5027fafac9dee77618886aefee29c Author: Eugene Burkov <[email protected]> Date: Thu Oct 13 18:24:20 2022 +0300 all: imp code, docs commit 59549c4f74ee17b10eae542d1f1828d4e59894c9 Author: Eugene Burkov <[email protected]> Date: Tue Oct 11 18:49:09 2022 +0300 dhcpd: use netip initially commit 1af623096b0517d07752385540f2f750f7f5b3bb Author: Eugene Burkov <[email protected]> Date: Fri Sep 30 18:03:52 2022 +0300 all: imp docs, code commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7 Author: Eugene Burkov <[email protected]> Date: Thu Sep 29 14:56:37 2022 +0300 all: use netip for web commit 38305e555a6884c3bd1b0839330b942ce0e59093 Author: Eugene Burkov <[email protected]> Date: Wed Sep 28 19:13:58 2022 +0300 add basic lla </s> remove func newDNSCrypt(hosts []net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { </s> add func newDNSCrypt(hosts []netip.Addr, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { </s> remove if !sid.Equal(s.conf.dnsIPAddrs[0]) { </s> add if !sid.Equal(s.conf.dnsIPAddrs[0].AsSlice()) { </s> remove config.DNS.BindHosts = []net.IP{req.DNS.IP} </s> add config.DNS.BindHosts = []netip.Addr{req.DNS.IP} </s> remove defaultIP := net.IP{192, 168, 1, 1} </s> add defaultIP := netip.MustParseAddr("192.168.1.1") </s> remove if !s.conf.subnet.Contains(reqIP) { </s> add if !s.conf.subnet.Contains(netip.AddrFrom4(*(*[4]byte)(ip4))) { </s> remove var subnet *net.IPNet </s> add var subnet netip.Prefix
https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a
internal/home/web.go
keep add keep keep keep keep keep
<mask> import React, { Component } from 'react'; <mask> import PropTypes from 'prop-types'; <mask> import Card from '../ui/Card'; <mask> <mask> class UserRules extends Component { <mask> handleChange = (e) => { <mask> const { value } = e.currentTarget; </s> Complete translate client to Vietnamese </s> remove export default class UserRules extends Component { </s> add class UserRules extends Component { </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> add import { Trans } from 'react-i18next'; </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> remove export default class Modal extends Component { </s> add class Modal extends Component {
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/UserRules.js
keep keep keep keep replace keep keep keep keep keep
<mask> import React, { Component } from 'react'; <mask> import PropTypes from 'prop-types'; <mask> import Card from '../ui/Card'; <mask> <mask> export default class UserRules extends Component { <mask> handleChange = (e) => { <mask> const { value } = e.currentTarget; <mask> this.props.handleRulesChange(value); <mask> }; <mask> </s> Complete translate client to Vietnamese </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> add import { Trans } from 'react-i18next'; </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> remove export default class Modal extends Component { </s> add class Modal extends Component {
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/UserRules.js
keep add keep keep keep keep
<mask> <mask> render() { <mask> return ( <mask> <Card <mask> title={ t('Custom filtering rules') } <mask> subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') } </s> Complete translate client to Vietnamese </s> remove title="Custom filtering rules" subtitle="Enter one rule on a line. You can use either adblock rules or hosts files syntax." </s> add title={ t('Custom filtering rules') } subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') } </s> remove title="Filters and hosts blocklists" subtitle="AdGuard Home understands basic adblock rules and hosts files syntax." </s> add title={ t('Filters and hosts blocklists') } subtitle={ t('AdGuard Home understands basic adblock rules and hosts files syntax.') } </s> remove title="New filter subscription" inputDescription="Enter a valid URL to a filter subscription or a hosts file." </s> add title={ t('New filter subscription') } inputDescription={ t('Enter a valid URL to a filter subscription or a hosts file.') } </s> remove <PageTitle title="Filters" /> </s> add <PageTitle title={ t('Filters') } /> </s> add const { t } = this.props; </s> remove <PageTitle title="Query Log" subtitle="Last 5000 DNS queries"> </s> add <PageTitle title={ t('Query Log') } subtitle={ t('Last 5000 DNS queries') }>
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/UserRules.js
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> render() { <mask> return ( <mask> <Card <mask> title="Custom filtering rules" <mask> subtitle="Enter one rule on a line. You can use either adblock rules or hosts files syntax." <mask> > <mask> <form onSubmit={this.handleSubmit}> <mask> <textarea className="form-control form-control--textarea-large" value={this.props.userRules} onChange={this.handleChange} /> <mask> <div className="card-actions"> <mask> <button </s> Complete translate client to Vietnamese </s> add const { t } = this.props; </s> remove title="Filters and hosts blocklists" subtitle="AdGuard Home understands basic adblock rules and hosts files syntax." </s> add title={ t('Filters and hosts blocklists') } subtitle={ t('AdGuard Home understands basic adblock rules and hosts files syntax.') } </s> remove <PageTitle title="Filters" /> </s> add <PageTitle title={ t('Filters') } /> </s> remove title="New filter subscription" inputDescription="Enter a valid URL to a filter subscription or a hosts file." </s> add title={ t('New filter subscription') } inputDescription={ t('Enter a valid URL to a filter subscription or a hosts file.') } </s> add const { t } = this.props; </s> remove <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button> <button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button> </s> add <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button> <button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button>
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/UserRules.js
keep keep keep keep replace keep keep keep keep keep
<mask> className="btn btn-success btn-standart" <mask> type="submit" <mask> onClick={this.handleSubmit} <mask> > <mask> Apply <mask> </button> <mask> </div> <mask> </form> <mask> <hr/> <mask> <div className="list leading-loose"> </s> Complete translate client to Vietnamese </s> remove Examples: </s> add <Trans>Examples</Trans>: </s> remove <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button> <button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button> </s> add <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button> <button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button> </s> remove noDataText="No filters added" </s> add noDataText={ t('No filters added') } </s> remove {buttonText} </s> add <Trans>{buttonText}</Trans> </s> remove >Enable log</button> </s> add ><Trans>Enable log</Trans></button> </s> remove <button type="button" className="btn btn-secondary" onClick={this.closeModal}>Cancel</button> <button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}>Add filter</button> </s> add <button type="button" className="btn btn-secondary" onClick={this.closeModal}><Trans>Cancel</Trans></button> <button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}><Trans>Add filter</Trans></button>
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/UserRules.js
keep keep replace keep keep replace replace keep keep keep
<mask> <hr/> <mask> <div className="list leading-loose"> <mask> Examples: <mask> <ol className="leading-loose"> <mask> <li> <mask> <code>||example.org^</code> - block access to the example.org domain <mask> and all its subdomains <mask> </li> <mask> <li> <mask> <code> @@||example.org^</code> - unblock access to the example.org </s> Complete translate client to Vietnamese </s> remove <code> @@||example.org^</code> - unblock access to the example.org domain and all its subdomains </s> add <code> @@||example.org^</code> - { t('unblock access to the example.org domain and all its subdomains') } </s> remove <code>127.0.0.1 example.org</code> - AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains). </s> add <code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') } </s> remove <code>! Here goes a comment</code> - just a comment </s> add <code>{ t('! Here goes a comment') }</code> - { t('just a comment') } </s> remove <code># Also a comment</code> - just a comment </s> add <code>{ t('# Also a comment') }</code> - { t('just a comment') } </s> remove Apply </s> add <Trans>Apply</Trans>
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/UserRules.js
keep keep replace replace keep keep replace replace
<mask> </li> <mask> <li> <mask> <code> @@||example.org^</code> - unblock access to the example.org <mask> domain and all its subdomains <mask> </li> <mask> <li> <mask> <code>127.0.0.1 example.org</code> - AdGuard Home will now return <mask> 127.0.0.1 address for the example.org domain (but not its subdomains). </s> Complete translate client to Vietnamese </s> remove <code>||example.org^</code> - block access to the example.org domain and all its subdomains </s> add <code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') } </s> remove <code>! Here goes a comment</code> - just a comment </s> add <code>{ t('! Here goes a comment') }</code> - { t('just a comment') } </s> remove Examples: </s> add <Trans>Examples</Trans>: </s> remove <code># Also a comment</code> - just a comment </s> add <code>{ t('# Also a comment') }</code> - { t('just a comment') } </s> remove title="Filters and hosts blocklists" subtitle="AdGuard Home understands basic adblock rules and hosts files syntax." </s> add title={ t('Filters and hosts blocklists') } subtitle={ t('AdGuard Home understands basic adblock rules and hosts files syntax.') }
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/UserRules.js
keep keep keep keep replace keep keep keep keep keep
<mask> <code>127.0.0.1 example.org</code> - AdGuard Home will now return <mask> 127.0.0.1 address for the example.org domain (but not its subdomains). <mask> </li> <mask> <li> <mask> <code>! Here goes a comment</code> - just a comment <mask> </li> <mask> <li> <mask> <code># Also a comment</code> - just a comment <mask> </li> <mask> </ol> </s> Complete translate client to Vietnamese </s> remove <code>127.0.0.1 example.org</code> - AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains). </s> add <code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') } </s> remove <code># Also a comment</code> - just a comment </s> add <code>{ t('# Also a comment') }</code> - { t('just a comment') } </s> remove <code> @@||example.org^</code> - unblock access to the example.org domain and all its subdomains </s> add <code> @@||example.org^</code> - { t('unblock access to the example.org domain and all its subdomains') } </s> remove <code>||example.org^</code> - block access to the example.org domain and all its subdomains </s> add <code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') } </s> remove Examples: </s> add <Trans>Examples</Trans>: </s> remove title="New filter subscription" inputDescription="Enter a valid URL to a filter subscription or a hosts file." </s> add title={ t('New filter subscription') } inputDescription={ t('Enter a valid URL to a filter subscription or a hosts file.') }
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/UserRules.js
keep keep keep keep replace keep keep keep keep keep
<mask> <li> <mask> <code>! Here goes a comment</code> - just a comment <mask> </li> <mask> <li> <mask> <code># Also a comment</code> - just a comment <mask> </li> <mask> </ol> <mask> </div> <mask> </Card> <mask> ); </s> Complete translate client to Vietnamese </s> remove <code>! Here goes a comment</code> - just a comment </s> add <code>{ t('! Here goes a comment') }</code> - { t('just a comment') } </s> remove <code>127.0.0.1 example.org</code> - AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains). </s> add <code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') } </s> remove title="New filter subscription" inputDescription="Enter a valid URL to a filter subscription or a hosts file." </s> add title={ t('New filter subscription') } inputDescription={ t('Enter a valid URL to a filter subscription or a hosts file.') } </s> remove <code> @@||example.org^</code> - unblock access to the example.org domain and all its subdomains </s> add <code> @@||example.org^</code> - { t('unblock access to the example.org domain and all its subdomains') } </s> remove <code>||example.org^</code> - block access to the example.org domain and all its subdomains </s> add <code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') } </s> remove Examples: </s> add <Trans>Examples</Trans>:
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/UserRules.js
keep keep add keep keep keep
<mask> userRules: PropTypes.string, <mask> handleRulesChange: PropTypes.func, <mask> handleRulesSubmit: PropTypes.func, <mask> }; <mask> <mask> export default withNamespaces()(UserRules); </s> Complete translate client to Vietnamese </s> add t: PropTypes.func, </s> add t: PropTypes.func, </s> remove export default Logs; </s> add export default withNamespaces()(Logs); </s> add t: PropTypes.func, </s> remove export default Filters; </s> add export default withNamespaces()(Filters); </s> remove export default class Modal extends Component { </s> add class Modal extends Component {
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/UserRules.js
keep keep add keep keep keep keep keep
<mask> import React, { Component } from 'react'; <mask> import ReactTable from 'react-table'; <mask> import PropTypes from 'prop-types'; <mask> import Modal from '../ui/Modal'; <mask> import PageTitle from '../ui/PageTitle'; <mask> import Card from '../ui/Card'; <mask> import UserRules from './UserRules'; <mask> import './Filters.css'; </s> Complete translate client to Vietnamese </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> remove export default class UserRules extends Component { </s> add class UserRules extends Component { </s> add import { Trans } from 'react-i18next'; </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> remove export default class Modal extends Component { </s> add class Modal extends Component {
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> ); <mask> }; <mask> <mask> columns = [{ <mask> Header: 'Enabled', <mask> accessor: 'enabled', <mask> Cell: this.renderCheckbox, <mask> width: 90, <mask> className: 'text-center', <mask> }, { </s> Complete translate client to Vietnamese </s> remove Header: 'Name', </s> add Header: this.props.t('Name'), </s> remove Header: 'Actions', </s> add Header: this.props.t('Actions'), </s> remove Header: 'Last time updated', </s> add Header: this.props.t('Last time updated'), </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> remove Header: 'Time', </s> add Header: t('Time'), </s> add const { t } = this.props;
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/index.js
keep replace keep keep keep replace
<mask> }, { <mask> Header: 'Name', <mask> accessor: 'name', <mask> Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), <mask> }, { <mask> Header: 'Filter URL', </s> Complete translate client to Vietnamese </s> remove Header: 'Rules count', </s> add Header: this.props.t('Rules count'), </s> remove Header: 'Time', </s> add Header: t('Time'), </s> remove Header: 'Domain name', </s> add Header: t('Domain name'), </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> remove Header: 'Actions', </s> add Header: this.props.t('Actions'),
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/index.js
keep keep replace keep keep keep keep replace
<mask> Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><a href={value} target='_blank' rel='noopener noreferrer' className="link logs__text">{value}</a></div>), <mask> }, { <mask> Header: 'Rules count', <mask> accessor: 'rulesCount', <mask> className: 'text-center', <mask> Cell: props => props.value.toLocaleString(), <mask> }, { <mask> Header: 'Last time updated', </s> Complete translate client to Vietnamese </s> remove Header: 'Filter URL', </s> add Header: this.props.t('Filter URL'), </s> remove Header: 'Actions', </s> add Header: this.props.t('Actions'), </s> remove Header: 'Name', </s> add Header: this.props.t('Name'), </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> remove Header: 'Time', </s> add Header: t('Time'),
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> Header: 'Last time updated', <mask> accessor: 'lastUpdated', <mask> className: 'text-center', <mask> }, { <mask> Header: 'Actions', <mask> accessor: 'url', <mask> Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), <mask> className: 'text-center', <mask> width: 75, <mask> sortable: false, </s> Complete translate client to Vietnamese </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> remove Header: 'Last time updated', </s> add Header: this.props.t('Last time updated'), </s> remove Header: 'Rules count', </s> add Header: this.props.t('Rules count'), </s> remove Header: 'Name', </s> add Header: this.props.t('Name'), </s> remove Header: 'Enabled', </s> add Header: this.props.t('Enabled'), </s> remove Header: 'Filter URL', </s> add Header: this.props.t('Filter URL'),
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> className: 'text-center', <mask> }, { <mask> Header: 'Actions', <mask> accessor: 'url', <mask> Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), <mask> className: 'text-center', <mask> width: 75, <mask> sortable: false, <mask> }, <mask> ]; </s> Complete translate client to Vietnamese </s> remove Header: 'Actions', </s> add Header: this.props.t('Actions'), </s> remove Header: 'Name', </s> add Header: this.props.t('Name'), </s> remove Header: 'Last time updated', </s> add Header: this.props.t('Last time updated'), </s> remove Header: 'Rules count', </s> add Header: this.props.t('Rules count'), </s> remove Header: 'Enabled', </s> add Header: this.props.t('Enabled'), </s> remove Header: 'Filter URL', </s> add Header: this.props.t('Filter URL'),
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/index.js
keep keep keep add keep keep keep keep keep
<mask> }, <mask> ]; <mask> <mask> render() { <mask> const { filters, userRules } = this.props.filtering; <mask> return ( <mask> <div> <mask> <PageTitle title={ t('Filters') } /> <mask> <div className="content"> </s> Complete translate client to Vietnamese </s> remove <PageTitle title="Filters" /> </s> add <PageTitle title={ t('Filters') } /> </s> remove const { queryLogs, dashboard } = this.props; </s> add const { queryLogs, dashboard, t } = this.props; </s> remove <PageTitle title="Query Log" subtitle="Last 5000 DNS queries"> </s> add <PageTitle title={ t('Query Log') } subtitle={ t('Last 5000 DNS queries') }> </s> add const { t } = this.props; </s> remove <input type="text" className={inputNameClass} placeholder="Enter name" onChange={this.handleNameChange} /> <input type="text" className={inputUrlClass} placeholder="Enter URL" onChange={this.handleUrlChange} /> </s> add <input type="text" className={inputNameClass} placeholder={ this.props.t('Enter name') } onChange={this.handleNameChange} /> <input type="text" className={inputUrlClass} placeholder={ this.props.t('Enter URL') } onChange={this.handleUrlChange} /> </s> remove title="Custom filtering rules" subtitle="Enter one rule on a line. You can use either adblock rules or hosts files syntax." </s> add title={ t('Custom filtering rules') } subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') }
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/index.js
keep keep keep replace keep keep keep keep replace replace keep keep keep
<mask> const { filters, userRules } = this.props.filtering; <mask> return ( <mask> <div> <mask> <PageTitle title="Filters" /> <mask> <div className="content"> <mask> <div className="row"> <mask> <div className="col-md-12"> <mask> <Card <mask> title="Filters and hosts blocklists" <mask> subtitle="AdGuard Home understands basic adblock rules and hosts files syntax." <mask> > <mask> <ReactTable <mask> data={filters} </s> Complete translate client to Vietnamese </s> add const { t } = this.props; </s> remove title="Custom filtering rules" subtitle="Enter one rule on a line. You can use either adblock rules or hosts files syntax." </s> add title={ t('Custom filtering rules') } subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') } </s> add const { t } = this.props; </s> remove const { queryLogs, dashboard } = this.props; </s> add const { queryLogs, dashboard, t } = this.props; </s> remove <PageTitle title="Query Log" subtitle="Last 5000 DNS queries"> </s> add <PageTitle title={ t('Query Log') } subtitle={ t('Last 5000 DNS queries') }>
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/index.js
keep keep keep keep replace keep keep keep replace replace keep keep keep
<mask> <ReactTable <mask> data={filters} <mask> columns={this.columns} <mask> showPagination={false} <mask> noDataText="No filters added" <mask> minRows={4} // TODO find out what to show if rules.length is 0 <mask> /> <mask> <div className="card-actions"> <mask> <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button> <mask> <button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button> <mask> </div> <mask> </Card> <mask> </div> </s> Complete translate client to Vietnamese </s> remove >Disable log</button> </s> add ><Trans>Disable log</Trans></button> </s> remove >Download log file</button> </s> add ><Trans>Download log file</Trans></button> </s> remove Apply </s> add <Trans>Apply</Trans> </s> remove <button type="button" className="btn btn-secondary" onClick={this.closeModal}>Cancel</button> <button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}>Add filter</button> </s> add <button type="button" className="btn btn-secondary" onClick={this.closeModal}><Trans>Cancel</Trans></button> <button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}><Trans>Add filter</Trans></button> </s> remove >Enable log</button> </s> add ><Trans>Enable log</Trans></button>
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/index.js
keep keep keep keep replace replace keep keep keep keep keep
<mask> isOpen={this.props.filtering.isFilteringModalOpen} <mask> toggleModal={this.props.toggleFilteringModal} <mask> addFilter={this.props.addFilter} <mask> isFilterAdded={this.props.filtering.isFilterAdded} <mask> title="New filter subscription" <mask> inputDescription="Enter a valid URL to a filter subscription or a hosts file." <mask> /> <mask> </div> <mask> ); <mask> } <mask> } </s> Complete translate client to Vietnamese </s> remove <code># Also a comment</code> - just a comment </s> add <code>{ t('# Also a comment') }</code> - { t('just a comment') } </s> remove title="Custom filtering rules" subtitle="Enter one rule on a line. You can use either adblock rules or hosts files syntax." </s> add title={ t('Custom filtering rules') } subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') } </s> add const { t } = this.props; </s> remove <code>! Here goes a comment</code> - just a comment </s> add <code>{ t('! Here goes a comment') }</code> - { t('just a comment') } </s> remove <code>127.0.0.1 example.org</code> - AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains). </s> add <code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') } </s> remove <PageTitle title="Filters" /> </s> add <PageTitle title={ t('Filters') } />
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/index.js
keep keep keep add keep keep keep keep
<mask> addFilter: PropTypes.func.isRequired, <mask> toggleFilteringModal: PropTypes.func.isRequired, <mask> handleRulesChange: PropTypes.func.isRequired, <mask> refreshFilters: PropTypes.func.isRequired, <mask> }; <mask> <mask> <mask> export default withNamespaces()(Filters); </s> Complete translate client to Vietnamese </s> remove export default Filters; </s> add export default withNamespaces()(Filters); </s> add t: PropTypes.func, </s> add t: PropTypes.func, </s> remove export default Logs; </s> add export default withNamespaces()(Logs); </s> add t: PropTypes.func, </s> remove export default class Modal extends Component { </s> add class Modal extends Component {
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/index.js
keep keep keep keep replace
<mask> refreshFilters: PropTypes.func.isRequired, <mask> }; <mask> <mask> <mask> export default Filters; </s> Complete translate client to Vietnamese </s> add t: PropTypes.func, </s> add t: PropTypes.func, </s> remove export default Logs; </s> add export default withNamespaces()(Logs); </s> add t: PropTypes.func, </s> add t: PropTypes.func, </s> remove export default class Modal extends Component { </s> add class Modal extends Component {
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Filters/index.js
keep keep add keep keep keep keep keep keep
<mask> import { saveAs } from 'file-saver/FileSaver'; <mask> import escapeRegExp from 'lodash/escapeRegExp'; <mask> import endsWith from 'lodash/endsWith'; <mask> <mask> import { formatTime } from '../../helpers/helpers'; <mask> import { getTrackerData } from '../../helpers/trackers/trackers'; <mask> import PageTitle from '../ui/PageTitle'; <mask> import Card from '../ui/Card'; <mask> import Loading from '../ui/Loading'; </s> Complete translate client to Vietnamese </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> add import { Trans, withNamespaces } from 'react-i18next'; </s> remove export default class UserRules extends Component { </s> add class UserRules extends Component { </s> add import { Trans } from 'react-i18next'; </s> remove const { queryLogs, dashboard } = this.props; </s> add const { queryLogs, dashboard, t } = this.props;
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> type="button" <mask> className={`btn btn-sm ${buttonClass}`} <mask> onClick={() => this.toggleBlocking(buttonText.toLowerCase(), domain)} <mask> > <mask> {buttonText} <mask> </button> <mask> </div> <mask> ); <mask> } <mask> </s> Complete translate client to Vietnamese </s> remove <button type="button" className="btn btn-secondary" onClick={this.closeModal}>Cancel</button> <button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}>Add filter</button> </s> add <button type="button" className="btn btn-secondary" onClick={this.closeModal}><Trans>Cancel</Trans></button> <button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}><Trans>Add filter</Trans></button> </s> remove >Enable log</button> </s> add ><Trans>Enable log</Trans></button> </s> remove Apply </s> add <Trans>Apply</Trans> </s> remove Url added successfully </s> add <Trans>Url added successfully</Trans> </s> remove >Disable log</button> </s> add ><Trans>Disable log</Trans></button> </s> remove {this.props.message} </s> add <Trans>{this.props.message}</Trans>
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Logs/index.js
keep keep keep add keep keep keep keep keep
<mask> ); <mask> } <mask> <mask> renderLogs(logs) { <mask> const columns = [{ <mask> Header: t('Time'), <mask> accessor: 'time', <mask> maxWidth: 110, <mask> filterable: false, </s> Complete translate client to Vietnamese </s> remove Header: 'Time', </s> add Header: t('Time'), </s> remove Header: 'Domain name', </s> add Header: t('Domain name'), </s> remove Header: 'Enabled', </s> add Header: this.props.t('Enabled'), </s> remove Header: 'Response', </s> add Header: t('Response'), </s> remove Header: 'Type', </s> add Header: t('Type'), </s> remove Header: 'Client', </s> add Header: t('Client'),
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> renderLogs(logs) { <mask> const columns = [{ <mask> Header: 'Time', <mask> accessor: 'time', <mask> maxWidth: 110, <mask> filterable: false, <mask> Cell: ({ value }) => (<div className="logs__row"><span className="logs__text" title={value}>{formatTime(value)}</span></div>), <mask> }, { </s> Complete translate client to Vietnamese </s> remove Header: 'Domain name', </s> add Header: t('Domain name'), </s> add const { t } = this.props; </s> remove Header: 'Filter URL', </s> add Header: this.props.t('Filter URL'), </s> remove Header: 'Name', </s> add Header: this.props.t('Name'), </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> remove Header: 'Rules count', </s> add Header: this.props.t('Rules count'),
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> maxWidth: 110, <mask> filterable: false, <mask> Cell: ({ value }) => (<div className="logs__row"><span className="logs__text" title={value}>{formatTime(value)}</span></div>), <mask> }, { <mask> Header: 'Domain name', <mask> accessor: 'domain', <mask> Cell: (row) => { <mask> const response = row.value; <mask> const trackerData = getTrackerData(response); <mask> </s> Complete translate client to Vietnamese </s> remove Header: 'Time', </s> add Header: t('Time'), </s> remove Header: 'Filter URL', </s> add Header: this.props.t('Filter URL'), </s> remove Header: 'Name', </s> add Header: this.props.t('Name'), </s> remove Header: 'Response', </s> add Header: t('Response'), </s> add const { t } = this.props; </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Logs/index.js
keep replace keep keep keep replace
<mask> }, { <mask> Header: 'Type', <mask> accessor: 'type', <mask> maxWidth: 60, <mask> }, { <mask> Header: 'Response', </s> Complete translate client to Vietnamese </s> remove Header: 'Time', </s> add Header: t('Time'), </s> remove Header: 'Last time updated', </s> add Header: this.props.t('Last time updated'), </s> remove Header: 'Name', </s> add Header: this.props.t('Name'), </s> remove Header: 'Client', </s> add Header: t('Client'), </s> remove Header: 'Domain name', </s> add Header: t('Domain name'),
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> return ( <mask> <div className="logs__row"> <mask> {this.renderTooltip(isFiltered, rule)} <mask> <span>Empty</span> <mask> </div> <mask> ); <mask> }, <mask> filterMethod: (filter, row) => { <mask> if (filter.value === 'filtered') { </s> Complete translate client to Vietnamese </s> add const { t } = this.props; </s> remove const { queryLogs, dashboard } = this.props; </s> add const { queryLogs, dashboard, t } = this.props; </s> remove <input type="text" className={inputNameClass} placeholder="Enter name" onChange={this.handleNameChange} /> <input type="text" className={inputUrlClass} placeholder="Enter URL" onChange={this.handleUrlChange} /> </s> add <input type="text" className={inputNameClass} placeholder={ this.props.t('Enter name') } onChange={this.handleNameChange} /> <input type="text" className={inputUrlClass} placeholder={ this.props.t('Enter URL') } onChange={this.handleUrlChange} /> </s> remove Url added successfully </s> add <Trans>Url added successfully</Trans> </s> remove Header: 'Type', </s> add Header: t('Type'), </s> remove <PageTitle title="Query Log" subtitle="Last 5000 DNS queries"> </s> add <PageTitle title={ t('Query Log') } subtitle={ t('Last 5000 DNS queries') }>
https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252
client/src/components/Logs/index.js