docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep add keep keep keep keep
<mask> - '8.8.8.8' <mask> 'upstream_timeout': '1s' <mask> 'required': <mask> - 'blocking_mode' <mask> - 'bootstrap_servers' <mask> - 'cache_size' <mask> - 'cache_ttl_max' </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37baddbf94 Author: Ainar Garipov <[email protected]> Date: Tue Aug 9 18:55:42 2022 +0300 all: upd openapi, websvc </s> add 'upstream_timeout': '1s' </s> remove - 'force_https' </s> add </s> add - 'http' </s> add 'addresses': - '127.0.0.1:53' - '192.168.1.1:53' </s> add - 'upstream_timeout' </s> add 'responses': '200': 'description': > An OK response. 'content': 'text/plain': 'example': 'OK'
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
keep keep keep add keep keep keep keep keep keep
<mask> - 'ipv6' <mask> - 'rate_limit' <mask> - 'upstream_mode' <mask> - 'upstream_servers' <mask> <mask> 'DnsSettingsPatch': <mask> 'description': > <mask> DNS server settings update object. <mask> 'example': <mask> 'cache_size': 4194304 </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37baddbf94 Author: Ainar Garipov <[email protected]> Date: Tue Aug 9 18:55:42 2022 +0300 all: upd openapi, websvc </s> add 'addresses': - '127.0.0.1:53' - '192.168.1.1:53' </s> add 'responses': '200': 'description': > An OK response. 'content': 'text/plain': 'example': 'OK' </s> add - 'http' </s> add - 'addresses' </s> remove - 'force_https' </s> add </s> add 'upstream_timeout': '1s'
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
keep keep keep add keep keep keep keep keep keep
<mask> 'cache_size': 4194304 <mask> 'upstream_servers': <mask> - '1.1.1.1' <mask> 'properties': <mask> 'blocking_ipv4': <mask> 'description': > <mask> IPv4 address to respond with when `blocking_mode` is `custom_ip`. <mask> See the documentation for the `DnsBlockingMode` schema. If <mask> `blocking_mode` is different from `custom_ip`, this property is not <mask> included. </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37baddbf94 Author: Ainar Garipov <[email protected]> Date: Tue Aug 9 18:55:42 2022 +0300 all: upd openapi, websvc </s> remove SecureAddresses []*netutil.IPPort </s> add SecureAddresses []netip.AddrPort </s> add - 'upstream_timeout' </s> remove Addresses []*netutil.IPPort </s> add Addresses []netip.AddrPort </s> remove 'force_https': 'description': > If `true`, enabled the HTTP-to-HTTPS redirect. 'type': 'boolean' </s> add </s> add 'responses': '200': 'description': > An OK response. 'content': 'text/plain': 'example': 'OK' </s> add 'upstream_timeout': '1s'
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
keep keep add keep keep keep keep
<mask> 'items': <mask> '$ref': '#/components/schemas/UpstreamServerAddr' <mask> 'type': 'array' <mask> 'type': 'object' <mask> <mask> 'DnsType': <mask> 'description': > </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37baddbf94 Author: Ainar Garipov <[email protected]> Date: Tue Aug 9 18:55:42 2022 +0300 all: upd openapi, websvc </s> add 'addresses': 'description': > Addresses on which to serve plain DNS, in ip:port format. Empty array disables plain DNS. 'items': 'type': 'string' 'type': 'array' </s> remove 'force_https': 'description': > If `true`, enabled the HTTP-to-HTTPS redirect. 'type': 'boolean' </s> add </s> add 'PatchV1SettingsHttpResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsHttpResp' 'description': > A successful response to a `PATCH /api/v1/settings/http` request. </s> add 'addresses': - '127.0.0.1:53' - '192.168.1.1:53' </s> add 'PatchV1SettingsHttpReq': '$ref': '#/components/schemas/HttpSettingsPatch' 'PatchV1SettingsHttpResp': '$ref': '#/components/schemas/HttpSettings' </s> add 'http': '$ref': '#/components/schemas/HttpSettings'
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
keep keep keep add keep keep keep keep keep
<mask> 'dhcp': <mask> '$ref': '#/components/schemas/DhcpSettings' <mask> 'dns': <mask> '$ref': '#/components/schemas/DnsSettings' <mask> 'log': <mask> '$ref': '#/components/schemas/LogSettings' <mask> 'protection': <mask> '$ref': '#/components/schemas/ProtectionSettings' <mask> 'stats': </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37baddbf94 Author: Ainar Garipov <[email protected]> Date: Tue Aug 9 18:55:42 2022 +0300 all: upd openapi, websvc </s> add 'PatchV1SettingsHttpReq': '$ref': '#/components/schemas/HttpSettingsPatch' 'PatchV1SettingsHttpResp': '$ref': '#/components/schemas/HttpSettings' </s> add 'PatchV1SettingsHttpReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsHttpReq' 'required': true </s> add 'PatchV1SettingsHttpResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsHttpResp' 'description': > A successful response to a `PATCH /api/v1/settings/http` request. </s> add 'addresses': - '127.0.0.1:53' - '192.168.1.1:53' </s> add 'upstream_timeout': 'description': > Upstream request timeout, as a human readable duration. 'type': 'string' </s> remove 'force_https': 'description': > If `true`, enabled the HTTP-to-HTTPS redirect. 'type': 'boolean' </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
keep add keep keep keep keep
<mask> - 'dhcp' <mask> - 'dns' <mask> - 'log' <mask> - 'protection' <mask> - 'stats' <mask> - 'tls' </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37baddbf94 Author: Ainar Garipov <[email protected]> Date: Tue Aug 9 18:55:42 2022 +0300 all: upd openapi, websvc </s> add - 'addresses' </s> remove - 'force_https' </s> add </s> add 'upstream_timeout': '1s' </s> add 'addresses': - '127.0.0.1:53' - '192.168.1.1:53' </s> add - 'upstream_timeout' </s> add 'responses': '200': 'description': > An OK response. 'content': 'text/plain': 'example': 'OK'
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
keep keep keep add keep keep keep keep keep
<mask> <mask> 'PatchV1SettingsDnsResp': <mask> '$ref': '#/components/schemas/DnsSettings' <mask> <mask> 'PatchV1SettingsLogReq': <mask> '$ref': '#/components/schemas/LogSettingsPatch' <mask> <mask> 'PatchV1SettingsLogResp': <mask> '$ref': '#/components/schemas/LogSettings' </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37baddbf94 Author: Ainar Garipov <[email protected]> Date: Tue Aug 9 18:55:42 2022 +0300 all: upd openapi, websvc </s> add 'http': '$ref': '#/components/schemas/HttpSettings' </s> add 'PatchV1SettingsHttpReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsHttpReq' 'required': true </s> add 'PatchV1SettingsHttpResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsHttpResp' 'description': > A successful response to a `PATCH /api/v1/settings/http` request. </s> add 'addresses': - '127.0.0.1:53' - '192.168.1.1:53' </s> add 'upstream_timeout': 'description': > Upstream request timeout, as a human readable duration. 'type': 'string' </s> remove 'force_https': 'description': > If `true`, enabled the HTTP-to-HTTPS redirect. 'type': 'boolean' </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
keep keep keep keep replace keep keep keep keep keep
<mask> TLS and encryption settings. <mask> 'example': <mask> 'certificate_path': '/etc/ssl/example.com.cert' <mask> 'enabled': true <mask> 'force_https': true <mask> 'port_dns_over_quic': 784 <mask> 'port_dns_over_tls': 853 <mask> 'port_https': 443 <mask> 'private_key_path': '/etc/ssl/example.com.key' <mask> 'server_name': 'dns.example.com' </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37baddbf94 Author: Ainar Garipov <[email protected]> Date: Tue Aug 9 18:55:42 2022 +0300 all: upd openapi, websvc </s> remove - 'force_https' </s> add </s> add 'PatchV1SettingsHttpReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsHttpReq' 'required': true </s> remove 'force_https': 'description': > If `true`, enabled the HTTP-to-HTTPS redirect. 'type': 'boolean' </s> add </s> add 'addresses': - '127.0.0.1:53' - '192.168.1.1:53' </s> remove Addresses []*netutil.IPPort </s> add Addresses []netip.AddrPort </s> add - 'upstream_timeout'
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
keep keep keep keep replace keep keep keep keep keep
<mask> 'private_key_path': '/etc/ssl/example.com.key' <mask> 'server_name': 'dns.example.com' <mask> 'required': <mask> - 'enabled' <mask> - 'force_https' <mask> - 'port_dns_over_quic' <mask> - 'port_dns_over_tls' <mask> - 'port_https' <mask> - 'server_name' <mask> </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37baddbf94 Author: Ainar Garipov <[email protected]> Date: Tue Aug 9 18:55:42 2022 +0300 all: upd openapi, websvc </s> add - 'addresses' </s> add 'upstream_timeout': '1s' </s> add - 'http' </s> add 'addresses': - '127.0.0.1:53' - '192.168.1.1:53' </s> add - 'upstream_timeout' </s> remove 'force_https': true </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> If `true`, AdGuard Home the administration interface will be served <mask> over HTTPS, and the DNS server will listen requests over <mask> DNS-over-TLS and other protocols. <mask> 'type': 'boolean' <mask> 'force_https': <mask> 'description': > <mask> If `true`, enabled the HTTP-to-HTTPS redirect. <mask> 'type': 'boolean' <mask> 'port_dns_over_quic': <mask> 'default': 784 <mask> 'description': > <mask> The DNS-over-QUIC port. If `0`, DNS-over-QUIC is disabled. <mask> 'format': 'int64' </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37baddbf94 Author: Ainar Garipov <[email protected]> Date: Tue Aug 9 18:55:42 2022 +0300 all: upd openapi, websvc </s> add 'addresses': 'description': > Addresses on which to serve plain DNS, in ip:port format. Empty array disables plain DNS. 'items': 'type': 'string' 'type': 'array' </s> add 'upstream_timeout': 'description': > Upstream request timeout, as a human readable duration. 'type': 'string' </s> remove 'force_https': true </s> add </s> remove SecureAddresses []*netutil.IPPort </s> add SecureAddresses []netip.AddrPort </s> remove Addresses []*netutil.IPPort </s> add Addresses []netip.AddrPort </s> add 'responses': '200': 'description': > An OK response. 'content': 'text/plain': 'example': 'OK'
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
keep keep keep add
<mask> } <mask> <mask> return addrs, nil <mask> } </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove // netIface is the interface for network interface methods. type netIface interface { Addrs() ([]net.Addr, error) } // ifaceIPAddrs returns the interface's IP addresses. func ifaceIPAddrs(iface netIface, ipv ipVersion) (ips []net.IP, err error) { addrs, err := iface.Addrs() if err != nil { return nil, err } for _, a := range addrs { var ip net.IP switch a := a.(type) { case *net.IPAddr: ip = a.IP case *net.IPNet: ip = a.IP default: continue } // Assume that net.(*Interface).Addrs can only return valid IPv4 // and IPv6 addresses. Thus, if it isn't an IPv4 address, it // must be an IPv6 one. switch ipv { case ipVersion4: if ip4 := ip.To4(); ip4 != nil { ips = append(ips, ip4) } case ipVersion6: if ip6 := ip.To4(); ip6 == nil { ips = append(ips, ip) } default: return nil, fmt.Errorf("invalid ip version %d", ipv) } } return ips, nil } </s> add </s> remove // ifaceDNSIPAddrs returns IP addresses of the interface suitable to send to // clients as DNS addresses. If err is nil, addrs contains either no addresses // or at least two. // // It makes up to maxAttempts attempts to get the addresses if there are none, // each time using the provided backoff. Sometimes an interface needs a few // seconds to really ititialize. // // See https://github.com/AdguardTeam/AdGuardHome/issues/2304. func ifaceDNSIPAddrs( iface netIface, ipv ipVersion, maxAttempts int, backoff time.Duration, ) (addrs []net.IP, err error) { var n int for n = 1; n <= maxAttempts; n++ { addrs, err = ifaceIPAddrs(iface, ipv) if err != nil { return nil, fmt.Errorf("getting ip addrs: %w", err) } if len(addrs) > 0 { break } log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n) time.Sleep(backoff) } switch len(addrs) { case 0: // Don't return errors in case the users want to try and enable // the DHCP server later. t := time.Duration(n) * backoff log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t) return nil, nil case 1: // Some Android devices use 8.8.8.8 if there is not a secondary // DNS server. Fix that by setting the secondary DNS address to // the same address. // // See https://github.com/AdguardTeam/AdGuardHome/issues/1708. log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv) addrs = append(addrs, addrs[0]) default: // Go on. } log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n) return addrs, nil } </s> add </s> remove func isTimeout(err error) bool { operr, ok := err.(*net.OpError) if !ok { return false } return operr.Timeout() } </s> add </s> remove bcastIP := netutil.CloneIP(routerIP) for i, b := range subnetMask { bcastIP[i] |= ^b } s.conf.broadcastIP = bcastIP </s> add s.conf.broadcastIP = aghnet.BroadcastFromIPNet(s.conf.subnet) </s> remove found6, err6 := CheckIfOtherDHCPServersPresentV6(interfaceName) if found6 { result.V6.OtherServer.Found = "yes" } else if err6 != nil { </s> add if err6 != nil { </s> remove dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion4, defaultMaxAttempts, defaultBackoff) </s> add dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion4, defaultMaxAttempts, defaultBackoff, )
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/aghnet/net.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> <mask> return getHardwarePortInfo(hardwarePort) <mask> } <mask> <mask> // getNetworkSetupHardwareReports parses the output of the `networksetup -listallhardwareports` command <mask> // it returns a map where the key is the interface name, and the value is the "hardware port" <mask> // returns nil if it fails to parse the output <mask> func getNetworkSetupHardwareReports() map[string]string { <mask> _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") <mask> if err != nil { <mask> return nil <mask> } </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove // ifaceDNSIPAddrs returns IP addresses of the interface suitable to send to // clients as DNS addresses. If err is nil, addrs contains either no addresses // or at least two. // // It makes up to maxAttempts attempts to get the addresses if there are none, // each time using the provided backoff. Sometimes an interface needs a few // seconds to really ititialize. // // See https://github.com/AdguardTeam/AdGuardHome/issues/2304. func ifaceDNSIPAddrs( iface netIface, ipv ipVersion, maxAttempts int, backoff time.Duration, ) (addrs []net.IP, err error) { var n int for n = 1; n <= maxAttempts; n++ { addrs, err = ifaceIPAddrs(iface, ipv) if err != nil { return nil, fmt.Errorf("getting ip addrs: %w", err) } if len(addrs) > 0 { break } log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n) time.Sleep(backoff) } switch len(addrs) { case 0: // Don't return errors in case the users want to try and enable // the DHCP server later. t := time.Duration(n) * backoff log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t) return nil, nil case 1: // Some Android devices use 8.8.8.8 if there is not a secondary // DNS server. Fix that by setting the secondary DNS address to // the same address. // // See https://github.com/AdguardTeam/AdGuardHome/issues/1708. log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv) addrs = append(addrs, addrs[0]) default: // Go on. } log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n) return addrs, nil } </s> add </s> remove // netIface is the interface for network interface methods. type netIface interface { Addrs() ([]net.Addr, error) } // ifaceIPAddrs returns the interface's IP addresses. func ifaceIPAddrs(iface netIface, ipv ipVersion) (ips []net.IP, err error) { addrs, err := iface.Addrs() if err != nil { return nil, err } for _, a := range addrs { var ip net.IP switch a := a.(type) { case *net.IPAddr: ip = a.IP case *net.IPNet: ip = a.IP default: continue } // Assume that net.(*Interface).Addrs can only return valid IPv4 // and IPv6 addresses. Thus, if it isn't an IPv4 address, it // must be an IPv6 one. switch ipv { case ipVersion4: if ip4 := ip.To4(); ip4 != nil { ips = append(ips, ip4) } case ipVersion6: if ip6 := ip.To4(); ip6 == nil { ips = append(ips, ip) } default: return nil, fmt.Errorf("invalid ip version %d", ipv) } } return ips, nil } </s> add </s> remove "github.com/AdguardTeam/golibs/log" ) // ipVersion is a documentational alias for int. Use it when the integer means // IP version. type ipVersion = int // IP version constants. const ( ipVersion4 ipVersion = 4 ipVersion6 ipVersion = 6 </s> add </s> add // BroadcastFromIPNet calculates the broadcast IP address for n. func BroadcastFromIPNet(n *net.IPNet) (dc net.IP) { dc = netutil.CloneIP(n.IP) mask := n.Mask if mask == nil { mask = dc.DefaultMask() } for i, b := range mask { dc[i] |= ^b } return dc } </s> remove defaultDiscoverTime = time.Second * 3 </s> add </s> remove func isTimeout(err error) bool { operr, ok := err.(*net.OpError) if !ok { return false } return operr.Timeout() } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/aghnet/net_darwin.go
replace replace keep keep keep keep keep
<mask> //go:build !(linux || darwin || freebsd) <mask> // +build !linux,!darwin,!freebsd <mask> <mask> package aghnet <mask> <mask> import ( <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove "fmt" "net" </s> add </s> remove "github.com/AdguardTeam/golibs/log" ) // ipVersion is a documentational alias for int. Use it when the integer means // IP version. type ipVersion = int // IP version constants. const ( ipVersion4 ipVersion = 4 ipVersion6 ipVersion = 6 </s> add </s> add "net" </s> add "github.com/stretchr/testify/assert" </s> remove defaultDiscoverTime = time.Second * 3 </s> add </s> remove // netIface is the interface for network interface methods. type netIface interface { Addrs() ([]net.Addr, error) } // ifaceIPAddrs returns the interface's IP addresses. func ifaceIPAddrs(iface netIface, ipv ipVersion) (ips []net.IP, err error) { addrs, err := iface.Addrs() if err != nil { return nil, err } for _, a := range addrs { var ip net.IP switch a := a.(type) { case *net.IPAddr: ip = a.IP case *net.IPNet: ip = a.IP default: continue } // Assume that net.(*Interface).Addrs can only return valid IPv4 // and IPv6 addresses. Thus, if it isn't an IPv4 address, it // must be an IPv6 one. switch ipv { case ipVersion4: if ip4 := ip.To4(); ip4 != nil { ips = append(ips, ip4) } case ipVersion6: if ip6 := ip.To4(); ip6 == nil { ips = append(ips, ip) } default: return nil, fmt.Errorf("invalid ip version %d", ipv) } } return ips, nil } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/aghnet/net_others.go
keep add keep keep keep keep keep
<mask> <mask> import ( <mask> "testing" <mask> <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> add "github.com/stretchr/testify/assert" </s> remove "fmt" "net" </s> add </s> remove "github.com/AdguardTeam/golibs/log" ) // ipVersion is a documentational alias for int. Use it when the integer means // IP version. type ipVersion = int // IP version constants. const ( ipVersion4 ipVersion = 4 ipVersion6 ipVersion = 6 </s> add </s> remove //go:build !(linux || darwin || freebsd) // +build !linux,!darwin,!freebsd </s> add //go:build !(linux || darwin || freebsd || openbsd) // +build !linux,!darwin,!freebsd,!openbsd </s> remove defaultDiscoverTime = time.Second * 3 </s> add </s> remove // netIface is the interface for network interface methods. type netIface interface { Addrs() ([]net.Addr, error) } // ifaceIPAddrs returns the interface's IP addresses. func ifaceIPAddrs(iface netIface, ipv ipVersion) (ips []net.IP, err error) { addrs, err := iface.Addrs() if err != nil { return nil, err } for _, a := range addrs { var ip net.IP switch a := a.(type) { case *net.IPAddr: ip = a.IP case *net.IPNet: ip = a.IP default: continue } // Assume that net.(*Interface).Addrs can only return valid IPv4 // and IPv6 addresses. Thus, if it isn't an IPv4 address, it // must be an IPv6 one. switch ipv { case ipVersion4: if ip4 := ip.To4(); ip4 != nil { ips = append(ips, ip4) } case ipVersion6: if ip6 := ip.To4(); ip6 == nil { ips = append(ips, ip) } default: return nil, fmt.Errorf("invalid ip version %d", ipv) } } return ips, nil } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/aghnet/net_test.go
keep keep keep add keep keep keep keep keep
<mask> import ( <mask> "net" <mask> "testing" <mask> <mask> "github.com/stretchr/testify/require" <mask> ) <mask> <mask> func TestGetValidNetInterfacesForWeb(t *testing.T) { <mask> ifaces, err := GetValidNetInterfacesForWeb() </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> add "net" </s> remove "fmt" "net" </s> add </s> remove func isTimeout(err error) bool { operr, ok := err.(*net.OpError) if !ok { return false } return operr.Timeout() } </s> add </s> remove "github.com/AdguardTeam/golibs/log" ) // ipVersion is a documentational alias for int. Use it when the integer means // IP version. type ipVersion = int // IP version constants. const ( ipVersion4 ipVersion = 4 ipVersion6 ipVersion = 6 </s> add </s> remove // netIface is the interface for network interface methods. type netIface interface { Addrs() ([]net.Addr, error) } // ifaceIPAddrs returns the interface's IP addresses. func ifaceIPAddrs(iface netIface, ipv ipVersion) (ips []net.IP, err error) { addrs, err := iface.Addrs() if err != nil { return nil, err } for _, a := range addrs { var ip net.IP switch a := a.(type) { case *net.IPAddr: ip = a.IP case *net.IPNet: ip = a.IP default: continue } // Assume that net.(*Interface).Addrs can only return valid IPv4 // and IPv6 addresses. Thus, if it isn't an IPv4 address, it // must be an IPv6 one. switch ipv { case ipVersion4: if ip4 := ip.To4(); ip4 != nil { ips = append(ips, ip4) } case ipVersion6: if ip6 := ip.To4(); ip6 == nil { ips = append(ips, ip) } default: return nil, fmt.Errorf("invalid ip version %d", ipv) } } return ips, nil } </s> add </s> add // BroadcastFromIPNet calculates the broadcast IP address for n. func BroadcastFromIPNet(n *net.IPNet) (dc net.IP) { dc = netutil.CloneIP(n.IP) mask := n.Mask if mask == nil { mask = dc.DefaultMask() } for i, b := range mask { dc[i] |= ^b } return dc }
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/aghnet/net_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> "github.com/AdguardTeam/golibs/netutil" <mask> ) <mask> <mask> const ( <mask> defaultDiscoverTime = time.Second * 3 <mask> // leaseExpireStatic is used to define the Expiry field for static <mask> // leases. <mask> // <mask> // TODO(e.burkov): Remove it when static leases determining mechanism <mask> // will be improved. </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove "github.com/AdguardTeam/golibs/log" ) // ipVersion is a documentational alias for int. Use it when the integer means // IP version. type ipVersion = int // IP version constants. const ( ipVersion4 ipVersion = 4 ipVersion6 ipVersion = 6 </s> add </s> remove // getNetworkSetupHardwareReports parses the output of the `networksetup -listallhardwareports` command // it returns a map where the key is the interface name, and the value is the "hardware port" // returns nil if it fails to parse the output </s> add // getNetworkSetupHardwareReports parses the output of the `networksetup // -listallhardwareports` command it returns a map where the key is the // interface name, and the value is the "hardware port" returns nil if it fails // to parse the output // // TODO(e.burkov): There should be more proper approach than parsing the // command output. For example, see // https://developer.apple.com/documentation/systemconfiguration. </s> remove // netIface is the interface for network interface methods. type netIface interface { Addrs() ([]net.Addr, error) } // ifaceIPAddrs returns the interface's IP addresses. func ifaceIPAddrs(iface netIface, ipv ipVersion) (ips []net.IP, err error) { addrs, err := iface.Addrs() if err != nil { return nil, err } for _, a := range addrs { var ip net.IP switch a := a.(type) { case *net.IPAddr: ip = a.IP case *net.IPNet: ip = a.IP default: continue } // Assume that net.(*Interface).Addrs can only return valid IPv4 // and IPv6 addresses. Thus, if it isn't an IPv4 address, it // must be an IPv6 one. switch ipv { case ipVersion4: if ip4 := ip.To4(); ip4 != nil { ips = append(ips, ip4) } case ipVersion6: if ip6 := ip.To4(); ip6 == nil { ips = append(ips, ip) } default: return nil, fmt.Errorf("invalid ip version %d", ipv) } } return ips, nil } </s> add </s> remove // ifaceDNSIPAddrs returns IP addresses of the interface suitable to send to // clients as DNS addresses. If err is nil, addrs contains either no addresses // or at least two. // // It makes up to maxAttempts attempts to get the addresses if there are none, // each time using the provided backoff. Sometimes an interface needs a few // seconds to really ititialize. // // See https://github.com/AdguardTeam/AdGuardHome/issues/2304. func ifaceDNSIPAddrs( iface netIface, ipv ipVersion, maxAttempts int, backoff time.Duration, ) (addrs []net.IP, err error) { var n int for n = 1; n <= maxAttempts; n++ { addrs, err = ifaceIPAddrs(iface, ipv) if err != nil { return nil, fmt.Errorf("getting ip addrs: %w", err) } if len(addrs) > 0 { break } log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n) time.Sleep(backoff) } switch len(addrs) { case 0: // Don't return errors in case the users want to try and enable // the DHCP server later. t := time.Duration(n) * backoff log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t) return nil, nil case 1: // Some Android devices use 8.8.8.8 if there is not a secondary // DNS server. Fix that by setting the secondary DNS address to // the same address. // // See https://github.com/AdguardTeam/AdGuardHome/issues/1708. log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv) addrs = append(addrs, addrs[0]) default: // Go on. } log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n) return addrs, nil } </s> add </s> remove result.V4.StaticIP.IP = aghnet.GetSubnet(interfaceName).String() </s> add // TODO(e.burkov): The returned IP should only be of version 4. result.V4.StaticIP.IP = aghnet.GetSubnet(ifaceName).String() </s> remove //go:build !(linux || darwin || freebsd) // +build !linux,!darwin,!freebsd </s> add //go:build !(linux || darwin || freebsd || openbsd) // +build !linux,!darwin,!freebsd,!openbsd
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/dhcpd.go
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> "fmt" <mask> "net" <mask> ) <mask> <mask> func isTimeout(err error) bool { <mask> operr, ok := err.(*net.OpError) <mask> if !ok { <mask> return false <mask> } <mask> return operr.Timeout() <mask> } <mask> <mask> func tryTo4(ip net.IP) (ip4 net.IP, err error) { <mask> if ip == nil { <mask> return nil, fmt.Errorf("%v is not an IP address", ip) <mask> } <mask> </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove // netIface is the interface for network interface methods. type netIface interface { Addrs() ([]net.Addr, error) } // ifaceIPAddrs returns the interface's IP addresses. func ifaceIPAddrs(iface netIface, ipv ipVersion) (ips []net.IP, err error) { addrs, err := iface.Addrs() if err != nil { return nil, err } for _, a := range addrs { var ip net.IP switch a := a.(type) { case *net.IPAddr: ip = a.IP case *net.IPNet: ip = a.IP default: continue } // Assume that net.(*Interface).Addrs can only return valid IPv4 // and IPv6 addresses. Thus, if it isn't an IPv4 address, it // must be an IPv6 one. switch ipv { case ipVersion4: if ip4 := ip.To4(); ip4 != nil { ips = append(ips, ip4) } case ipVersion6: if ip6 := ip.To4(); ip6 == nil { ips = append(ips, ip) } default: return nil, fmt.Errorf("invalid ip version %d", ipv) } } return ips, nil } </s> add </s> add // BroadcastFromIPNet calculates the broadcast IP address for n. func BroadcastFromIPNet(n *net.IPNet) (dc net.IP) { dc = netutil.CloneIP(n.IP) mask := n.Mask if mask == nil { mask = dc.DefaultMask() } for i, b := range mask { dc[i] |= ^b } return dc } </s> remove // ifaceDNSIPAddrs returns IP addresses of the interface suitable to send to // clients as DNS addresses. If err is nil, addrs contains either no addresses // or at least two. // // It makes up to maxAttempts attempts to get the addresses if there are none, // each time using the provided backoff. Sometimes an interface needs a few // seconds to really ititialize. // // See https://github.com/AdguardTeam/AdGuardHome/issues/2304. func ifaceDNSIPAddrs( iface netIface, ipv ipVersion, maxAttempts int, backoff time.Duration, ) (addrs []net.IP, err error) { var n int for n = 1; n <= maxAttempts; n++ { addrs, err = ifaceIPAddrs(iface, ipv) if err != nil { return nil, fmt.Errorf("getting ip addrs: %w", err) } if len(addrs) > 0 { break } log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n) time.Sleep(backoff) } switch len(addrs) { case 0: // Don't return errors in case the users want to try and enable // the DHCP server later. t := time.Duration(n) * backoff log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t) return nil, nil case 1: // Some Android devices use 8.8.8.8 if there is not a secondary // DNS server. Fix that by setting the secondary DNS address to // the same address. // // See https://github.com/AdguardTeam/AdGuardHome/issues/1708. log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv) addrs = append(addrs, addrs[0]) default: // Go on. } log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n) return addrs, nil } </s> add </s> remove interfaceName := strings.TrimSpace(string(body)) if interfaceName == "" { </s> add ifaceName := strings.TrimSpace(string(body)) if ifaceName == "" { </s> remove dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion4, defaultMaxAttempts, defaultBackoff) </s> add dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion4, defaultMaxAttempts, defaultBackoff, ) </s> remove dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion6, defaultMaxAttempts, defaultBackoff) </s> add dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion6, defaultMaxAttempts, defaultBackoff, )
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/helpers.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> http.Error(w, msg, http.StatusBadRequest) <mask> return <mask> } <mask> <mask> interfaceName := strings.TrimSpace(string(body)) <mask> if interfaceName == "" { <mask> msg := "empty interface name specified" <mask> log.Error(msg) <mask> http.Error(w, msg, http.StatusBadRequest) <mask> return <mask> } </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove // netIface is the interface for network interface methods. type netIface interface { Addrs() ([]net.Addr, error) } // ifaceIPAddrs returns the interface's IP addresses. func ifaceIPAddrs(iface netIface, ipv ipVersion) (ips []net.IP, err error) { addrs, err := iface.Addrs() if err != nil { return nil, err } for _, a := range addrs { var ip net.IP switch a := a.(type) { case *net.IPAddr: ip = a.IP case *net.IPNet: ip = a.IP default: continue } // Assume that net.(*Interface).Addrs can only return valid IPv4 // and IPv6 addresses. Thus, if it isn't an IPv4 address, it // must be an IPv6 one. switch ipv { case ipVersion4: if ip4 := ip.To4(); ip4 != nil { ips = append(ips, ip4) } case ipVersion6: if ip6 := ip.To4(); ip6 == nil { ips = append(ips, ip) } default: return nil, fmt.Errorf("invalid ip version %d", ipv) } } return ips, nil } </s> add </s> remove func isTimeout(err error) bool { operr, ok := err.(*net.OpError) if !ok { return false } return operr.Timeout() } </s> add </s> add // BroadcastFromIPNet calculates the broadcast IP address for n. func BroadcastFromIPNet(n *net.IPNet) (dc net.IP) { dc = netutil.CloneIP(n.IP) mask := n.Mask if mask == nil { mask = dc.DefaultMask() } for i, b := range mask { dc[i] |= ^b } return dc } </s> remove dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion4, defaultMaxAttempts, defaultBackoff) </s> add dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion4, defaultMaxAttempts, defaultBackoff, ) </s> remove dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion6, defaultMaxAttempts, defaultBackoff) </s> add dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion6, defaultMaxAttempts, defaultBackoff, ) </s> remove bcastIP := netutil.CloneIP(routerIP) for i, b := range subnetMask { bcastIP[i] |= ^b } s.conf.broadcastIP = bcastIP </s> add s.conf.broadcastIP = aghnet.BroadcastFromIPNet(s.conf.subnet)
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> result := dhcpSearchResult{ <mask> V4: dhcpSearchV4Result{ <mask> OtherServer: dhcpSearchOtherResult{}, <mask> StaticIP: dhcpStaticIPStatus{ <mask> Static: "yes", <mask> }, <mask> }, <mask> V6: dhcpSearchV6Result{ </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove OtherServer: dhcpSearchOtherResult{}, </s> add OtherServer: dhcpSearchOtherResult{ Found: "no", }, </s> remove found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) if err != nil { </s> add if isStaticIP, serr := aghnet.IfaceHasStaticIP(ifaceName); serr != nil { </s> remove interfaceName := strings.TrimSpace(string(body)) if interfaceName == "" { </s> add ifaceName := strings.TrimSpace(string(body)) if ifaceName == "" { </s> add // BroadcastFromIPNet calculates the broadcast IP address for n. func BroadcastFromIPNet(n *net.IPNet) (dc net.IP) { dc = netutil.CloneIP(n.IP) mask := n.Mask if mask == nil { mask = dc.DefaultMask() } for i, b := range mask { dc[i] |= ^b } return dc } </s> remove if found4 { result.V4.OtherServer.Found = "yes" } else if err4 != nil { </s> add found4, found6, err4, err6 := aghnet.CheckOtherDHCP(ifaceName) if err4 != nil { </s> remove bcastIP := netutil.CloneIP(routerIP) for i, b := range subnetMask { bcastIP[i] |= ^b } s.conf.broadcastIP = bcastIP </s> add s.conf.broadcastIP = aghnet.BroadcastFromIPNet(s.conf.subnet)
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
keep keep replace keep keep keep replace replace replace replace keep
<mask> }, <mask> V6: dhcpSearchV6Result{ <mask> OtherServer: dhcpSearchOtherResult{}, <mask> }, <mask> } <mask> <mask> found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) <mask> <mask> isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) <mask> if err != nil { <mask> result.V4.StaticIP.Static = "error" </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove OtherServer: dhcpSearchOtherResult{}, </s> add OtherServer: dhcpSearchOtherResult{ Found: "no", }, </s> remove result.V4.StaticIP.Error = err.Error() </s> add result.V4.StaticIP.Error = serr.Error() </s> remove if found4 { result.V4.OtherServer.Found = "yes" } else if err4 != nil { </s> add found4, found6, err4, err6 := aghnet.CheckOtherDHCP(ifaceName) if err4 != nil { </s> remove found6, err6 := CheckIfOtherDHCPServersPresentV6(interfaceName) if found6 { result.V6.OtherServer.Found = "yes" } else if err6 != nil { </s> add if err6 != nil { </s> remove result.V4.StaticIP.IP = aghnet.GetSubnet(interfaceName).String() </s> add // TODO(e.burkov): The returned IP should only be of version 4. result.V4.StaticIP.IP = aghnet.GetSubnet(ifaceName).String()
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
keep keep keep replace keep keep replace keep keep keep
<mask> isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) <mask> if err != nil { <mask> result.V4.StaticIP.Static = "error" <mask> result.V4.StaticIP.Error = err.Error() <mask> } else if !isStaticIP { <mask> result.V4.StaticIP.Static = "no" <mask> result.V4.StaticIP.IP = aghnet.GetSubnet(interfaceName).String() <mask> } <mask> <mask> if found4 { </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) if err != nil { </s> add if isStaticIP, serr := aghnet.IfaceHasStaticIP(ifaceName); serr != nil { </s> remove if found4 { result.V4.OtherServer.Found = "yes" } else if err4 != nil { </s> add found4, found6, err4, err6 := aghnet.CheckOtherDHCP(ifaceName) if err4 != nil { </s> add } else if found4 { result.V4.OtherServer.Found = "yes" </s> remove found6, err6 := CheckIfOtherDHCPServersPresentV6(interfaceName) if found6 { result.V6.OtherServer.Found = "yes" } else if err6 != nil { </s> add if err6 != nil { </s> add } else if found6 { result.V6.OtherServer.Found = "yes"
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> result.V4.StaticIP.Static = "no" <mask> result.V4.StaticIP.IP = aghnet.GetSubnet(interfaceName).String() <mask> } <mask> <mask> if found4 { <mask> result.V4.OtherServer.Found = "yes" <mask> } else if err4 != nil { <mask> result.V4.OtherServer.Found = "error" <mask> result.V4.OtherServer.Error = err4.Error() <mask> } <mask> <mask> found6, err6 := CheckIfOtherDHCPServersPresentV6(interfaceName) </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove found6, err6 := CheckIfOtherDHCPServersPresentV6(interfaceName) if found6 { result.V6.OtherServer.Found = "yes" } else if err6 != nil { </s> add if err6 != nil { </s> add } else if found4 { result.V4.OtherServer.Found = "yes" </s> remove result.V4.StaticIP.IP = aghnet.GetSubnet(interfaceName).String() </s> add // TODO(e.burkov): The returned IP should only be of version 4. result.V4.StaticIP.IP = aghnet.GetSubnet(ifaceName).String() </s> remove found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) if err != nil { </s> add if isStaticIP, serr := aghnet.IfaceHasStaticIP(ifaceName); serr != nil { </s> remove result.V4.StaticIP.Error = err.Error() </s> add result.V4.StaticIP.Error = serr.Error() </s> add } else if found6 { result.V6.OtherServer.Found = "yes"
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
keep add keep keep keep keep
<mask> result.V4.OtherServer.Found = "error" <mask> result.V4.OtherServer.Error = err4.Error() <mask> } <mask> if err6 != nil { <mask> result.V6.OtherServer.Found = "error" <mask> result.V6.OtherServer.Error = err6.Error() </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove found6, err6 := CheckIfOtherDHCPServersPresentV6(interfaceName) if found6 { result.V6.OtherServer.Found = "yes" } else if err6 != nil { </s> add if err6 != nil { </s> remove if found4 { result.V4.OtherServer.Found = "yes" } else if err4 != nil { </s> add found4, found6, err4, err6 := aghnet.CheckOtherDHCP(ifaceName) if err4 != nil { </s> add } else if found6 { result.V6.OtherServer.Found = "yes" </s> remove result.V4.StaticIP.IP = aghnet.GetSubnet(interfaceName).String() </s> add // TODO(e.burkov): The returned IP should only be of version 4. result.V4.StaticIP.IP = aghnet.GetSubnet(ifaceName).String() </s> remove result.V4.StaticIP.Error = err.Error() </s> add result.V4.StaticIP.Error = serr.Error() </s> remove found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) if err != nil { </s> add if isStaticIP, serr := aghnet.IfaceHasStaticIP(ifaceName); serr != nil {
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
<mask> } else if err4 != nil { <mask> result.V4.OtherServer.Found = "error" <mask> result.V4.OtherServer.Error = err4.Error() <mask> } <mask> <mask> found6, err6 := CheckIfOtherDHCPServersPresentV6(interfaceName) <mask> <mask> if found6 { <mask> result.V6.OtherServer.Found = "yes" <mask> } else if err6 != nil { <mask> result.V6.OtherServer.Found = "error" <mask> result.V6.OtherServer.Error = err6.Error() <mask> } <mask> <mask> w.Header().Set("Content-Type", "application/json") </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> add } else if found4 { result.V4.OtherServer.Found = "yes" </s> remove if found4 { result.V4.OtherServer.Found = "yes" } else if err4 != nil { </s> add found4, found6, err4, err6 := aghnet.CheckOtherDHCP(ifaceName) if err4 != nil { </s> add } else if found6 { result.V6.OtherServer.Found = "yes" </s> remove result.V4.StaticIP.IP = aghnet.GetSubnet(interfaceName).String() </s> add // TODO(e.burkov): The returned IP should only be of version 4. result.V4.StaticIP.IP = aghnet.GetSubnet(ifaceName).String() </s> remove found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) if err != nil { </s> add if isStaticIP, serr := aghnet.IfaceHasStaticIP(ifaceName); serr != nil { </s> remove result.V4.StaticIP.Error = err.Error() </s> add result.V4.StaticIP.Error = serr.Error()
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
keep keep add keep keep keep keep keep keep
<mask> if err6 != nil { <mask> result.V6.OtherServer.Found = "error" <mask> result.V6.OtherServer.Error = err6.Error() <mask> } <mask> <mask> w.Header().Set("Content-Type", "application/json") <mask> err = json.NewEncoder(w).Encode(result) <mask> if err != nil { <mask> httpError(r, w, http.StatusInternalServerError, "Failed to marshal DHCP found json: %s", err) </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove found6, err6 := CheckIfOtherDHCPServersPresentV6(interfaceName) if found6 { result.V6.OtherServer.Found = "yes" } else if err6 != nil { </s> add if err6 != nil { </s> add } else if found4 { result.V4.OtherServer.Found = "yes" </s> remove if found4 { result.V4.OtherServer.Found = "yes" } else if err4 != nil { </s> add found4, found6, err4, err6 := aghnet.CheckOtherDHCP(ifaceName) if err4 != nil { </s> remove found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) if err != nil { </s> add if isStaticIP, serr := aghnet.IfaceHasStaticIP(ifaceName); serr != nil { </s> remove result.V4.StaticIP.Error = err.Error() </s> add result.V4.StaticIP.Error = serr.Error() </s> remove result.V4.StaticIP.IP = aghnet.GetSubnet(interfaceName).String() </s> add // TODO(e.burkov): The returned IP should only be of version 4. result.V4.StaticIP.IP = aghnet.GetSubnet(ifaceName).String()
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> log.Debug("dhcpv4: starting...") <mask> <mask> dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion4, defaultMaxAttempts, defaultBackoff) <mask> if err != nil { <mask> return fmt.Errorf("interface %s: %w", ifaceName, err) <mask> } <mask> <mask> if len(dnsIPAddrs) == 0 { </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion6, defaultMaxAttempts, defaultBackoff) </s> add dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion6, defaultMaxAttempts, defaultBackoff, ) </s> remove bcastIP := netutil.CloneIP(routerIP) for i, b := range subnetMask { bcastIP[i] |= ^b } s.conf.broadcastIP = bcastIP </s> add s.conf.broadcastIP = aghnet.BroadcastFromIPNet(s.conf.subnet) </s> add } else if found6 { result.V6.OtherServer.Found = "yes" </s> remove func isTimeout(err error) bool { operr, ok := err.(*net.OpError) if !ok { return false } return operr.Timeout() } </s> add </s> remove found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) if err != nil { </s> add if isStaticIP, serr := aghnet.IfaceHasStaticIP(ifaceName); serr != nil { </s> remove interfaceName := strings.TrimSpace(string(body)) if interfaceName == "" { </s> add ifaceName := strings.TrimSpace(string(body)) if ifaceName == "" {
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v4.go
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
<mask> s.conf.subnet = &net.IPNet{ <mask> IP: routerIP, <mask> Mask: subnetMask, <mask> } <mask> <mask> bcastIP := netutil.CloneIP(routerIP) <mask> for i, b := range subnetMask { <mask> bcastIP[i] |= ^b <mask> } <mask> s.conf.broadcastIP = bcastIP <mask> <mask> s.conf.ipRange, err = newIPRange(conf.RangeStart, conf.RangeEnd) <mask> if err != nil { <mask> return s, fmt.Errorf("dhcpv4: %w", err) <mask> } </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> add // BroadcastFromIPNet calculates the broadcast IP address for n. func BroadcastFromIPNet(n *net.IPNet) (dc net.IP) { dc = netutil.CloneIP(n.IP) mask := n.Mask if mask == nil { mask = dc.DefaultMask() } for i, b := range mask { dc[i] |= ^b } return dc } </s> remove // netIface is the interface for network interface methods. type netIface interface { Addrs() ([]net.Addr, error) } // ifaceIPAddrs returns the interface's IP addresses. func ifaceIPAddrs(iface netIface, ipv ipVersion) (ips []net.IP, err error) { addrs, err := iface.Addrs() if err != nil { return nil, err } for _, a := range addrs { var ip net.IP switch a := a.(type) { case *net.IPAddr: ip = a.IP case *net.IPNet: ip = a.IP default: continue } // Assume that net.(*Interface).Addrs can only return valid IPv4 // and IPv6 addresses. Thus, if it isn't an IPv4 address, it // must be an IPv6 one. switch ipv { case ipVersion4: if ip4 := ip.To4(); ip4 != nil { ips = append(ips, ip4) } case ipVersion6: if ip6 := ip.To4(); ip6 == nil { ips = append(ips, ip) } default: return nil, fmt.Errorf("invalid ip version %d", ipv) } } return ips, nil } </s> add </s> remove found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) if err != nil { </s> add if isStaticIP, serr := aghnet.IfaceHasStaticIP(ifaceName); serr != nil { </s> remove dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion4, defaultMaxAttempts, defaultBackoff) </s> add dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion4, defaultMaxAttempts, defaultBackoff, ) </s> remove dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion6, defaultMaxAttempts, defaultBackoff) </s> add dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion6, defaultMaxAttempts, defaultBackoff, ) </s> remove found6, err6 := CheckIfOtherDHCPServersPresentV6(interfaceName) if found6 { result.V6.OtherServer.Found = "yes" } else if err6 != nil { </s> add if err6 != nil {
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v4.go
keep replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace
<mask> import ( <mask> "fmt" <mask> "net" <mask> "time" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> ) <mask> <mask> // ipVersion is a documentational alias for int. Use it when the integer means <mask> // IP version. <mask> type ipVersion = int <mask> <mask> // IP version constants. <mask> const ( <mask> ipVersion4 ipVersion = 4 <mask> ipVersion6 ipVersion = 6 </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove // netIface is the interface for network interface methods. type netIface interface { Addrs() ([]net.Addr, error) } // ifaceIPAddrs returns the interface's IP addresses. func ifaceIPAddrs(iface netIface, ipv ipVersion) (ips []net.IP, err error) { addrs, err := iface.Addrs() if err != nil { return nil, err } for _, a := range addrs { var ip net.IP switch a := a.(type) { case *net.IPAddr: ip = a.IP case *net.IPNet: ip = a.IP default: continue } // Assume that net.(*Interface).Addrs can only return valid IPv4 // and IPv6 addresses. Thus, if it isn't an IPv4 address, it // must be an IPv6 one. switch ipv { case ipVersion4: if ip4 := ip.To4(); ip4 != nil { ips = append(ips, ip4) } case ipVersion6: if ip6 := ip.To4(); ip6 == nil { ips = append(ips, ip) } default: return nil, fmt.Errorf("invalid ip version %d", ipv) } } return ips, nil } </s> add </s> remove defaultDiscoverTime = time.Second * 3 </s> add </s> remove // ifaceDNSIPAddrs returns IP addresses of the interface suitable to send to // clients as DNS addresses. If err is nil, addrs contains either no addresses // or at least two. // // It makes up to maxAttempts attempts to get the addresses if there are none, // each time using the provided backoff. Sometimes an interface needs a few // seconds to really ititialize. // // See https://github.com/AdguardTeam/AdGuardHome/issues/2304. func ifaceDNSIPAddrs( iface netIface, ipv ipVersion, maxAttempts int, backoff time.Duration, ) (addrs []net.IP, err error) { var n int for n = 1; n <= maxAttempts; n++ { addrs, err = ifaceIPAddrs(iface, ipv) if err != nil { return nil, fmt.Errorf("getting ip addrs: %w", err) } if len(addrs) > 0 { break } log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n) time.Sleep(backoff) } switch len(addrs) { case 0: // Don't return errors in case the users want to try and enable // the DHCP server later. t := time.Duration(n) * backoff log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t) return nil, nil case 1: // Some Android devices use 8.8.8.8 if there is not a secondary // DNS server. Fix that by setting the secondary DNS address to // the same address. // // See https://github.com/AdguardTeam/AdGuardHome/issues/1708. log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv) addrs = append(addrs, addrs[0]) default: // Go on. } log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n) return addrs, nil } </s> add </s> remove // getNetworkSetupHardwareReports parses the output of the `networksetup -listallhardwareports` command // it returns a map where the key is the interface name, and the value is the "hardware port" // returns nil if it fails to parse the output </s> add // getNetworkSetupHardwareReports parses the output of the `networksetup // -listallhardwareports` command it returns a map where the key is the // interface name, and the value is the "hardware port" returns nil if it fails // to parse the output // // TODO(e.burkov): There should be more proper approach than parsing the // command output. For example, see // https://developer.apple.com/documentation/systemconfiguration. </s> remove result.V4.StaticIP.IP = aghnet.GetSubnet(interfaceName).String() </s> add // TODO(e.burkov): The returned IP should only be of version 4. result.V4.StaticIP.IP = aghnet.GetSubnet(ifaceName).String()
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v46.go
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> ipVersion4 ipVersion = 4 <mask> ipVersion6 ipVersion = 6 <mask> ) <mask> <mask> // netIface is the interface for network interface methods. <mask> type netIface interface { <mask> Addrs() ([]net.Addr, error) <mask> } <mask> <mask> // ifaceIPAddrs returns the interface's IP addresses. <mask> func ifaceIPAddrs(iface netIface, ipv ipVersion) (ips []net.IP, err error) { <mask> addrs, err := iface.Addrs() <mask> if err != nil { <mask> return nil, err <mask> } <mask> <mask> for _, a := range addrs { <mask> var ip net.IP <mask> switch a := a.(type) { <mask> case *net.IPAddr: <mask> ip = a.IP <mask> case *net.IPNet: <mask> ip = a.IP <mask> default: <mask> continue <mask> } <mask> <mask> // Assume that net.(*Interface).Addrs can only return valid IPv4 <mask> // and IPv6 addresses. Thus, if it isn't an IPv4 address, it <mask> // must be an IPv6 one. <mask> switch ipv { <mask> case ipVersion4: <mask> if ip4 := ip.To4(); ip4 != nil { <mask> ips = append(ips, ip4) <mask> } <mask> case ipVersion6: <mask> if ip6 := ip.To4(); ip6 == nil { <mask> ips = append(ips, ip) <mask> } <mask> default: <mask> return nil, fmt.Errorf("invalid ip version %d", ipv) <mask> } <mask> } <mask> <mask> return ips, nil <mask> } <mask> <mask> // Currently used defaults for ifaceDNSAddrs. <mask> const ( <mask> defaultMaxAttempts int = 10 <mask> <mask> defaultBackoff time.Duration = 500 * time.Millisecond </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove // ifaceDNSIPAddrs returns IP addresses of the interface suitable to send to // clients as DNS addresses. If err is nil, addrs contains either no addresses // or at least two. // // It makes up to maxAttempts attempts to get the addresses if there are none, // each time using the provided backoff. Sometimes an interface needs a few // seconds to really ititialize. // // See https://github.com/AdguardTeam/AdGuardHome/issues/2304. func ifaceDNSIPAddrs( iface netIface, ipv ipVersion, maxAttempts int, backoff time.Duration, ) (addrs []net.IP, err error) { var n int for n = 1; n <= maxAttempts; n++ { addrs, err = ifaceIPAddrs(iface, ipv) if err != nil { return nil, fmt.Errorf("getting ip addrs: %w", err) } if len(addrs) > 0 { break } log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n) time.Sleep(backoff) } switch len(addrs) { case 0: // Don't return errors in case the users want to try and enable // the DHCP server later. t := time.Duration(n) * backoff log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t) return nil, nil case 1: // Some Android devices use 8.8.8.8 if there is not a secondary // DNS server. Fix that by setting the secondary DNS address to // the same address. // // See https://github.com/AdguardTeam/AdGuardHome/issues/1708. log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv) addrs = append(addrs, addrs[0]) default: // Go on. } log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n) return addrs, nil } </s> add </s> remove "github.com/AdguardTeam/golibs/log" ) // ipVersion is a documentational alias for int. Use it when the integer means // IP version. type ipVersion = int // IP version constants. const ( ipVersion4 ipVersion = 4 ipVersion6 ipVersion = 6 </s> add </s> remove func isTimeout(err error) bool { operr, ok := err.(*net.OpError) if !ok { return false } return operr.Timeout() } </s> add </s> add // BroadcastFromIPNet calculates the broadcast IP address for n. func BroadcastFromIPNet(n *net.IPNet) (dc net.IP) { dc = netutil.CloneIP(n.IP) mask := n.Mask if mask == nil { mask = dc.DefaultMask() } for i, b := range mask { dc[i] |= ^b } return dc } </s> remove // getNetworkSetupHardwareReports parses the output of the `networksetup -listallhardwareports` command // it returns a map where the key is the interface name, and the value is the "hardware port" // returns nil if it fails to parse the output </s> add // getNetworkSetupHardwareReports parses the output of the `networksetup // -listallhardwareports` command it returns a map where the key is the // interface name, and the value is the "hardware port" returns nil if it fails // to parse the output // // TODO(e.burkov): There should be more proper approach than parsing the // command output. For example, see // https://developer.apple.com/documentation/systemconfiguration. </s> remove result.V4.StaticIP.IP = aghnet.GetSubnet(interfaceName).String() </s> add // TODO(e.burkov): The returned IP should only be of version 4. result.V4.StaticIP.IP = aghnet.GetSubnet(ifaceName).String()
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v46.go
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
<mask> defaultMaxAttempts int = 10 <mask> <mask> defaultBackoff time.Duration = 500 * time.Millisecond <mask> ) <mask> <mask> // ifaceDNSIPAddrs returns IP addresses of the interface suitable to send to <mask> // clients as DNS addresses. If err is nil, addrs contains either no addresses <mask> // or at least two. <mask> // <mask> // It makes up to maxAttempts attempts to get the addresses if there are none, <mask> // each time using the provided backoff. Sometimes an interface needs a few <mask> // seconds to really ititialize. <mask> // <mask> // See https://github.com/AdguardTeam/AdGuardHome/issues/2304. <mask> func ifaceDNSIPAddrs( <mask> iface netIface, <mask> ipv ipVersion, <mask> maxAttempts int, <mask> backoff time.Duration, <mask> ) (addrs []net.IP, err error) { <mask> var n int <mask> for n = 1; n <= maxAttempts; n++ { <mask> addrs, err = ifaceIPAddrs(iface, ipv) <mask> if err != nil { <mask> return nil, fmt.Errorf("getting ip addrs: %w", err) <mask> } <mask> <mask> if len(addrs) > 0 { <mask> break <mask> } <mask> <mask> log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n) <mask> <mask> time.Sleep(backoff) <mask> } <mask> <mask> switch len(addrs) { <mask> case 0: <mask> // Don't return errors in case the users want to try and enable <mask> // the DHCP server later. <mask> t := time.Duration(n) * backoff <mask> log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t) <mask> <mask> return nil, nil <mask> case 1: <mask> // Some Android devices use 8.8.8.8 if there is not a secondary <mask> // DNS server. Fix that by setting the secondary DNS address to <mask> // the same address. <mask> // <mask> // See https://github.com/AdguardTeam/AdGuardHome/issues/1708. <mask> log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv) <mask> addrs = append(addrs, addrs[0]) <mask> default: <mask> // Go on. <mask> } <mask> <mask> log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n) <mask> <mask> return addrs, nil <mask> } </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove // netIface is the interface for network interface methods. type netIface interface { Addrs() ([]net.Addr, error) } // ifaceIPAddrs returns the interface's IP addresses. func ifaceIPAddrs(iface netIface, ipv ipVersion) (ips []net.IP, err error) { addrs, err := iface.Addrs() if err != nil { return nil, err } for _, a := range addrs { var ip net.IP switch a := a.(type) { case *net.IPAddr: ip = a.IP case *net.IPNet: ip = a.IP default: continue } // Assume that net.(*Interface).Addrs can only return valid IPv4 // and IPv6 addresses. Thus, if it isn't an IPv4 address, it // must be an IPv6 one. switch ipv { case ipVersion4: if ip4 := ip.To4(); ip4 != nil { ips = append(ips, ip4) } case ipVersion6: if ip6 := ip.To4(); ip6 == nil { ips = append(ips, ip) } default: return nil, fmt.Errorf("invalid ip version %d", ipv) } } return ips, nil } </s> add </s> remove // getNetworkSetupHardwareReports parses the output of the `networksetup -listallhardwareports` command // it returns a map where the key is the interface name, and the value is the "hardware port" // returns nil if it fails to parse the output </s> add // getNetworkSetupHardwareReports parses the output of the `networksetup // -listallhardwareports` command it returns a map where the key is the // interface name, and the value is the "hardware port" returns nil if it fails // to parse the output // // TODO(e.burkov): There should be more proper approach than parsing the // command output. For example, see // https://developer.apple.com/documentation/systemconfiguration. </s> remove defaultDiscoverTime = time.Second * 3 </s> add </s> remove "github.com/AdguardTeam/golibs/log" ) // ipVersion is a documentational alias for int. Use it when the integer means // IP version. type ipVersion = int // IP version constants. const ( ipVersion4 ipVersion = 4 ipVersion6 ipVersion = 6 </s> add </s> add // BroadcastFromIPNet calculates the broadcast IP address for n. func BroadcastFromIPNet(n *net.IPNet) (dc net.IP) { dc = netutil.CloneIP(n.IP) mask := n.Mask if mask == nil { mask = dc.DefaultMask() } for i, b := range mask { dc[i] |= ^b } return dc } </s> remove func isTimeout(err error) bool { operr, ok := err.(*net.OpError) if !ok { return false } return operr.Timeout() } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v46.go
keep add keep keep keep keep keep
<mask> "time" <mask> <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> "github.com/insomniacslk/dhcp/dhcpv6" <mask> "github.com/insomniacslk/dhcp/dhcpv6/server6" </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove "fmt" "net" </s> add </s> remove "github.com/AdguardTeam/golibs/log" ) // ipVersion is a documentational alias for int. Use it when the integer means // IP version. type ipVersion = int // IP version constants. const ( ipVersion4 ipVersion = 4 ipVersion6 ipVersion = 6 </s> add </s> remove defaultDiscoverTime = time.Second * 3 </s> add </s> remove dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion6, defaultMaxAttempts, defaultBackoff) </s> add dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion6, defaultMaxAttempts, defaultBackoff, ) </s> remove found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) if err != nil { </s> add if isStaticIP, serr := aghnet.IfaceHasStaticIP(ifaceName); serr != nil { </s> remove // getNetworkSetupHardwareReports parses the output of the `networksetup -listallhardwareports` command // it returns a map where the key is the interface name, and the value is the "hardware port" // returns nil if it fails to parse the output </s> add // getNetworkSetupHardwareReports parses the output of the `networksetup // -listallhardwareports` command it returns a map where the key is the // interface name, and the value is the "hardware port" returns nil if it fails // to parse the output // // TODO(e.burkov): There should be more proper approach than parsing the // command output. For example, see // https://developer.apple.com/documentation/systemconfiguration.
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v6.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> log.Debug("dhcpv6: starting...") <mask> <mask> dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion6, defaultMaxAttempts, defaultBackoff) <mask> if err != nil { <mask> return fmt.Errorf("interface %s: %w", ifaceName, err) <mask> } <mask> <mask> if len(dnsIPAddrs) == 0 { </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 17:02:02 2021 +0300 all: imp code, docs commit 5b598fc18a9b69a0256569f4c691bb6a2193dfbd Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 16:28:12 2021 +0300 all: mv logic, imp code, docs, log changes commit e3e1577a668fe3e5c61d075c390e4bd7268181ba Author: Eugene Burkov <[email protected]> Date: Thu Aug 12 14:15:10 2021 +0300 dhcpd: imp checkother commit 3cc8b058195c30a7ef0b7741ee8463270d9e47ff Author: Eugene Burkov <[email protected]> Date: Wed Aug 11 13:20:18 2021 +0300 all: imp bsd support </s> remove dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion4, defaultMaxAttempts, defaultBackoff) </s> add dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion4, defaultMaxAttempts, defaultBackoff, ) </s> remove bcastIP := netutil.CloneIP(routerIP) for i, b := range subnetMask { bcastIP[i] |= ^b } s.conf.broadcastIP = bcastIP </s> add s.conf.broadcastIP = aghnet.BroadcastFromIPNet(s.conf.subnet) </s> add } else if found6 { result.V6.OtherServer.Found = "yes" </s> remove func isTimeout(err error) bool { operr, ok := err.(*net.OpError) if !ok { return false } return operr.Timeout() } </s> add </s> remove found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) if err != nil { </s> add if isStaticIP, serr := aghnet.IfaceHasStaticIP(ifaceName); serr != nil { </s> remove interfaceName := strings.TrimSpace(string(body)) if interfaceName == "" { </s> add ifaceName := strings.TrimSpace(string(body)) if ifaceName == "" {
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v6.go
keep keep add keep keep keep keep keep keep
<mask> "dhcp_new_static_lease": "New static lease", <mask> "dhcp_static_leases_not_found": "No DHCP static leases found", <mask> "dhcp_add_static_lease": "Add static lease", <mask> "dhcp_reset": "Are you sure you want to reset the DHCP configuration?", <mask> "country": "Country", <mask> "city": "City", <mask> "delete_confirm": "Are you sure you want to delete \"{{key}}\"?", <mask> "form_enter_hostname": "Enter hostname", <mask> "error_details": "Error details", </s> Pull request: client: add reset leases btn Updates #1691. Squashed commit of the following: commit 2c48fb956aba28eae47071c9f7f4d579dde12955 Merge: 38f5191b 7547d3a4 Author: Ainar Garipov <[email protected]> Date: Thu Jun 17 14:28:23 2021 +0300 Merge branch 'master' into 1691-dhcp-reset-form commit 38f5191bcd62eb53e4663fccdfc2a60247881931 Author: Ildar Kamalov <[email protected]> Date: Thu Jun 17 13:14:59 2021 +0300 client: handle dhcp leases reset commit a97df17028ca640fd32b4d9762aa54fb381df7e5 Author: Ainar Garipov <[email protected]> Date: Wed Jun 16 17:12:10 2021 +0300 client: add reset leases btn </s> add [actions.resetDhcpLeasesSuccess]: (state) => ({ ...state, leases: [], staticLeases: [], }), </s> remove </div> <div className="col-12"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> </s> add <div className="btn-list mt-2"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> <button type="button" className="btn btn-secondary btn-standard mt-3" onClick={handleReset} > <Trans>dhcp_reset_leases</Trans> </button> </div> </s> remove type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> add type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> remove type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add const handleReset = () => { if (window.confirm(t('dhcp_reset_leases_confirm'))) { dispatch(resetDhcpLeases()); } }; </s> add resetDhcpLeases,
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/__locales/en.json
keep keep keep add keep keep keep keep
<mask> dispatch(resetDhcpFailure()); <mask> } <mask> }; <mask> <mask> export const toggleLeaseModal = createAction('TOGGLE_LEASE_MODAL'); <mask> <mask> export const addStaticLeaseRequest = createAction('ADD_STATIC_LEASE_REQUEST'); <mask> export const addStaticLeaseFailure = createAction('ADD_STATIC_LEASE_FAILURE'); </s> Pull request: client: add reset leases btn Updates #1691. Squashed commit of the following: commit 2c48fb956aba28eae47071c9f7f4d579dde12955 Merge: 38f5191b 7547d3a4 Author: Ainar Garipov <[email protected]> Date: Thu Jun 17 14:28:23 2021 +0300 Merge branch 'master' into 1691-dhcp-reset-form commit 38f5191bcd62eb53e4663fccdfc2a60247881931 Author: Ildar Kamalov <[email protected]> Date: Thu Jun 17 13:14:59 2021 +0300 client: handle dhcp leases reset commit a97df17028ca640fd32b4d9762aa54fb381df7e5 Author: Ainar Garipov <[email protected]> Date: Wed Jun 16 17:12:10 2021 +0300 client: add reset leases btn </s> add [actions.resetDhcpLeasesSuccess]: (state) => ({ ...state, leases: [], staticLeases: [], }), </s> remove </div> <div className="col-12"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> </s> add <div className="btn-list mt-2"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> <button type="button" className="btn btn-secondary btn-standard mt-3" onClick={handleReset} > <Trans>dhcp_reset_leases</Trans> </button> </div> </s> remove type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> add type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> remove type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add const handleReset = () => { if (window.confirm(t('dhcp_reset_leases_confirm'))) { dispatch(resetDhcpLeases()); } }; </s> add resetDhcpLeases,
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/actions/index.js
keep keep add keep keep keep keep keep
<mask> <mask> DHCP_RESET = { path: 'dhcp/reset', method: 'POST' }; <mask> <mask> getDhcpStatus() { <mask> const { path, method } = this.DHCP_STATUS; <mask> return this.makeRequest(path, method); <mask> } <mask> </s> Pull request: client: add reset leases btn Updates #1691. Squashed commit of the following: commit 2c48fb956aba28eae47071c9f7f4d579dde12955 Merge: 38f5191b 7547d3a4 Author: Ainar Garipov <[email protected]> Date: Thu Jun 17 14:28:23 2021 +0300 Merge branch 'master' into 1691-dhcp-reset-form commit 38f5191bcd62eb53e4663fccdfc2a60247881931 Author: Ildar Kamalov <[email protected]> Date: Thu Jun 17 13:14:59 2021 +0300 client: handle dhcp leases reset commit a97df17028ca640fd32b4d9762aa54fb381df7e5 Author: Ainar Garipov <[email protected]> Date: Wed Jun 16 17:12:10 2021 +0300 client: add reset leases btn </s> add resetDhcpLeases() { const { path, method } = this.DHCP_LEASES_RESET; return this.makeRequest(path, method); } </s> remove type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add [actions.resetDhcpLeasesSuccess]: (state) => ({ ...state, leases: [], staticLeases: [], }), </s> remove </div> <div className="col-12"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> </s> add <div className="btn-list mt-2"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> <button type="button" className="btn btn-secondary btn-standard mt-3" onClick={handleReset} > <Trans>dhcp_reset_leases</Trans> </button> </div> </s> remove type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> add type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> add const handleReset = () => { if (window.confirm(t('dhcp_reset_leases_confirm'))) { dispatch(resetDhcpLeases()); } };
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/api/Api.js
keep add keep keep keep keep keep keep
<mask> } <mask> <mask> // Installation <mask> INSTALL_GET_ADDRESSES = { path: 'install/get_addresses', method: 'GET' }; <mask> <mask> INSTALL_CONFIGURE = { path: 'install/configure', method: 'POST' }; <mask> <mask> INSTALL_CHECK_CONFIG = { path: 'install/check_config', method: 'POST' }; </s> Pull request: client: add reset leases btn Updates #1691. Squashed commit of the following: commit 2c48fb956aba28eae47071c9f7f4d579dde12955 Merge: 38f5191b 7547d3a4 Author: Ainar Garipov <[email protected]> Date: Thu Jun 17 14:28:23 2021 +0300 Merge branch 'master' into 1691-dhcp-reset-form commit 38f5191bcd62eb53e4663fccdfc2a60247881931 Author: Ildar Kamalov <[email protected]> Date: Thu Jun 17 13:14:59 2021 +0300 client: handle dhcp leases reset commit a97df17028ca640fd32b4d9762aa54fb381df7e5 Author: Ainar Garipov <[email protected]> Date: Wed Jun 16 17:12:10 2021 +0300 client: add reset leases btn </s> add DHCP_LEASES_RESET = { path: 'dhcp/reset_leases', method: 'POST' }; </s> add [actions.resetDhcpLeasesSuccess]: (state) => ({ ...state, leases: [], staticLeases: [], }), </s> remove </div> <div className="col-12"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> </s> add <div className="btn-list mt-2"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> <button type="button" className="btn btn-secondary btn-standard mt-3" onClick={handleReset} > <Trans>dhcp_reset_leases</Trans> </button> </div> </s> remove type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> add type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> remove type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add const handleReset = () => { if (window.confirm(t('dhcp_reset_leases_confirm'))) { dispatch(resetDhcpLeases()); } };
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/api/Api.js
keep keep add keep keep keep keep
<mask> getDhcpStatus, <mask> resetDhcp, <mask> setDhcpConfig, <mask> toggleDhcp, <mask> toggleLeaseModal, <mask> } from '../../../actions'; <mask> import FormDHCPv4 from './FormDHCPv4'; </s> Pull request: client: add reset leases btn Updates #1691. Squashed commit of the following: commit 2c48fb956aba28eae47071c9f7f4d579dde12955 Merge: 38f5191b 7547d3a4 Author: Ainar Garipov <[email protected]> Date: Thu Jun 17 14:28:23 2021 +0300 Merge branch 'master' into 1691-dhcp-reset-form commit 38f5191bcd62eb53e4663fccdfc2a60247881931 Author: Ildar Kamalov <[email protected]> Date: Thu Jun 17 13:14:59 2021 +0300 client: handle dhcp leases reset commit a97df17028ca640fd32b4d9762aa54fb381df7e5 Author: Ainar Garipov <[email protected]> Date: Wed Jun 16 17:12:10 2021 +0300 client: add reset leases btn </s> add [actions.resetDhcpLeasesSuccess]: (state) => ({ ...state, leases: [], staticLeases: [], }), </s> remove </div> <div className="col-12"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> </s> add <div className="btn-list mt-2"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> <button type="button" className="btn btn-secondary btn-standard mt-3" onClick={handleReset} > <Trans>dhcp_reset_leases</Trans> </button> </div> </s> remove type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> add type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> remove type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add const handleReset = () => { if (window.confirm(t('dhcp_reset_leases_confirm'))) { dispatch(resetDhcpLeases()); } }; </s> add resetDhcpLeases() { const { path, method } = this.DHCP_LEASES_RESET; return this.makeRequest(path, method); }
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/components/Settings/Dhcp/index.js
keep add keep keep keep keep
<mask> }; <mask> <mask> const enteredSomeV4Value = Object.values(v4) <mask> .some(Boolean); <mask> const enteredSomeV6Value = Object.values(v6) <mask> .some(Boolean); </s> Pull request: client: add reset leases btn Updates #1691. Squashed commit of the following: commit 2c48fb956aba28eae47071c9f7f4d579dde12955 Merge: 38f5191b 7547d3a4 Author: Ainar Garipov <[email protected]> Date: Thu Jun 17 14:28:23 2021 +0300 Merge branch 'master' into 1691-dhcp-reset-form commit 38f5191bcd62eb53e4663fccdfc2a60247881931 Author: Ildar Kamalov <[email protected]> Date: Thu Jun 17 13:14:59 2021 +0300 client: handle dhcp leases reset commit a97df17028ca640fd32b4d9762aa54fb381df7e5 Author: Ainar Garipov <[email protected]> Date: Wed Jun 16 17:12:10 2021 +0300 client: add reset leases btn </s> add [actions.resetDhcpLeasesSuccess]: (state) => ({ ...state, leases: [], staticLeases: [], }), </s> remove </div> <div className="col-12"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> </s> add <div className="btn-list mt-2"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> <button type="button" className="btn btn-secondary btn-standard mt-3" onClick={handleReset} > <Trans>dhcp_reset_leases</Trans> </button> </div> </s> remove type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> add type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> remove type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add resetDhcpLeases, </s> add resetDhcpLeases() { const { path, method } = this.DHCP_LEASES_RESET; return this.makeRequest(path, method); }
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/components/Settings/Dhcp/index.js
keep keep replace replace replace replace keep keep keep keep replace replace replace replace keep keep keep
<mask> {toggleDhcpButton} <mask> <button <mask> type="button" <mask> className={statusButtonClass} <mask> onClick={onClick} <mask> disabled={enabled || !interface_name || processingConfig} <mask> > <mask> <Trans>check_dhcp_servers</Trans> <mask> </button> <mask> <button <mask> type="button" <mask> className='btn btn-sm btn-outline-secondary' <mask> disabled={!enteredSomeValue || processingConfig} <mask> onClick={clear} <mask> > <mask> <Trans>reset_settings</Trans> <mask> </button> </s> Pull request: client: add reset leases btn Updates #1691. Squashed commit of the following: commit 2c48fb956aba28eae47071c9f7f4d579dde12955 Merge: 38f5191b 7547d3a4 Author: Ainar Garipov <[email protected]> Date: Thu Jun 17 14:28:23 2021 +0300 Merge branch 'master' into 1691-dhcp-reset-form commit 38f5191bcd62eb53e4663fccdfc2a60247881931 Author: Ildar Kamalov <[email protected]> Date: Thu Jun 17 13:14:59 2021 +0300 client: handle dhcp leases reset commit a97df17028ca640fd32b4d9762aa54fb381df7e5 Author: Ainar Garipov <[email protected]> Date: Wed Jun 16 17:12:10 2021 +0300 client: add reset leases btn </s> remove </div> <div className="col-12"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> </s> add <div className="btn-list mt-2"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> <button type="button" className="btn btn-secondary btn-standard mt-3" onClick={handleReset} > <Trans>dhcp_reset_leases</Trans> </button> </div> </s> add [actions.resetDhcpLeasesSuccess]: (state) => ({ ...state, leases: [], staticLeases: [], }), </s> add const handleReset = () => { if (window.confirm(t('dhcp_reset_leases_confirm'))) { dispatch(resetDhcpLeases()); } }; </s> add resetDhcpLeases, </s> add resetDhcpLeases() { const { path, method } = this.DHCP_LEASES_RESET; return this.makeRequest(path, method); }
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/components/Settings/Dhcp/index.js
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> processingAdding={processingAdding} <mask> processingDeleting={processingDeleting} <mask> cidr={cidr} <mask> /> <mask> </div> <mask> <div className="col-12"> <mask> <button <mask> type="button" <mask> className="btn btn-success btn-standard mt-3" <mask> onClick={toggleModal} <mask> disabled={disabledLeasesButton} <mask> > <mask> <Trans>dhcp_add_static_lease</Trans> <mask> </button> <mask> </div> <mask> </div> <mask> </Card> <mask> </>} <mask> </>; </s> Pull request: client: add reset leases btn Updates #1691. Squashed commit of the following: commit 2c48fb956aba28eae47071c9f7f4d579dde12955 Merge: 38f5191b 7547d3a4 Author: Ainar Garipov <[email protected]> Date: Thu Jun 17 14:28:23 2021 +0300 Merge branch 'master' into 1691-dhcp-reset-form commit 38f5191bcd62eb53e4663fccdfc2a60247881931 Author: Ildar Kamalov <[email protected]> Date: Thu Jun 17 13:14:59 2021 +0300 client: handle dhcp leases reset commit a97df17028ca640fd32b4d9762aa54fb381df7e5 Author: Ainar Garipov <[email protected]> Date: Wed Jun 16 17:12:10 2021 +0300 client: add reset leases btn </s> remove type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> add type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> remove type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add [actions.resetDhcpLeasesSuccess]: (state) => ({ ...state, leases: [], staticLeases: [], }), </s> add const handleReset = () => { if (window.confirm(t('dhcp_reset_leases_confirm'))) { dispatch(resetDhcpLeases()); } }; </s> add resetDhcpLeases, </s> add resetDhcpLeases() { const { path, method } = this.DHCP_LEASES_RESET; return this.makeRequest(path, method); }
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/components/Settings/Dhcp/index.js
keep keep add keep keep keep keep keep keep
<mask> v6: {}, <mask> interface_name: '', <mask> }), <mask> <mask> [actions.toggleLeaseModal]: (state) => { <mask> const newState = { <mask> ...state, <mask> isModalOpen: !state.isModalOpen, <mask> }; </s> Pull request: client: add reset leases btn Updates #1691. Squashed commit of the following: commit 2c48fb956aba28eae47071c9f7f4d579dde12955 Merge: 38f5191b 7547d3a4 Author: Ainar Garipov <[email protected]> Date: Thu Jun 17 14:28:23 2021 +0300 Merge branch 'master' into 1691-dhcp-reset-form commit 38f5191bcd62eb53e4663fccdfc2a60247881931 Author: Ildar Kamalov <[email protected]> Date: Thu Jun 17 13:14:59 2021 +0300 client: handle dhcp leases reset commit a97df17028ca640fd32b4d9762aa54fb381df7e5 Author: Ainar Garipov <[email protected]> Date: Wed Jun 16 17:12:10 2021 +0300 client: add reset leases btn </s> add const handleReset = () => { if (window.confirm(t('dhcp_reset_leases_confirm'))) { dispatch(resetDhcpLeases()); } }; </s> add export const resetDhcpLeasesRequest = createAction('RESET_DHCP_LEASES_REQUEST'); export const resetDhcpLeasesSuccess = createAction('RESET_DHCP_LEASES_SUCCESS'); export const resetDhcpLeasesFailure = createAction('RESET_DHCP_LEASES_FAILURE'); export const resetDhcpLeases = () => async (dispatch) => { dispatch(resetDhcpLeasesRequest()); try { const status = await apiClient.resetDhcpLeases(); dispatch(resetDhcpLeasesSuccess(status)); dispatch(addSuccessToast('dhcp_reset_leases_success')); } catch (error) { dispatch(addErrorToast({ error })); dispatch(resetDhcpLeasesFailure()); } }; </s> remove </div> <div className="col-12"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> </s> add <div className="btn-list mt-2"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabledLeasesButton} > <Trans>dhcp_add_static_lease</Trans> </button> <button type="button" className="btn btn-secondary btn-standard mt-3" onClick={handleReset} > <Trans>dhcp_reset_leases</Trans> </button> </div> </s> remove type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> add type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear} </s> remove type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig} </s> add resetDhcpLeases,
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/reducers/dhcp.js
keep add keep keep keep keep keep keep
<mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/ameshkov/dnscrypt/v2 v2.0.1 <mask> github.com/fsnotify/fsnotify v1.4.9 <mask> github.com/go-ping/ping v0.0.0-20201115131931-3300c582a663 <mask> github.com/gobuffalo/envy v1.9.0 // indirect <mask> github.com/gobuffalo/packr v1.30.1 <mask> github.com/gobuffalo/packr/v2 v2.8.1 // indirect <mask> github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714 </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add github.com/ti-mo/netfilter v0.4.0 </s> add github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be </s> remove s.ipset.init(s.conf.IPSETList) </s> add err := s.ipset.init(s.conf.IPSETList) if err != nil { return err } </s> remove err := s.prepareUpstreamSettings() </s> add err = s.prepareUpstreamSettings() </s> add github.com/mdlayher/netlink v1.1.1 h1:VqG+Voq9V4uZ+04vjIrcSCWDpf91B1xxbP4QBUmUJE8= </s> add err := s.ipset.Close() if err != nil { log.Error("closing ipset: %s", err) }
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.mod
keep keep keep add keep keep keep keep
<mask> github.com/kardianos/service v1.2.0 <mask> github.com/karrick/godirwalk v1.16.1 // indirect <mask> github.com/lucas-clemente/quic-go v0.19.3 <mask> github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 <mask> github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065 <mask> github.com/miekg/dns v1.1.35 <mask> github.com/rogpeppe/go-internal v1.6.2 // indirect <mask> github.com/satori/go.uuid v1.2.0 </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add github.com/ti-mo/netfilter v0.4.0 </s> add github.com/jsimonetti/rtnetlink v0.0.0-20201110080708-d2c240429e6c h1:7cpGGTQO6+OuYQWkueqeXuErSjs1NZtpALpv1x7Mq4g= </s> add github.com/digineo/go-ipset/v2 v2.2.1 </s> add github.com/mdlayher/netlink v0.0.0-20190313131330-258ea9dff42c/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= </s> add github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be h1:7JeFwhE5SIdgKRd0qnqjOYJxY8AML8x/j+/qvFZ8R+c= github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be/go.mod h1:WTYpFb/WTvlRJAyKhZL5/uy69TDDpHHu2VZmb2XgV7o= </s> add github.com/mdlayher/netlink v1.1.1 h1:VqG+Voq9V4uZ+04vjIrcSCWDpf91B1xxbP4QBUmUJE8=
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.mod
keep keep add keep keep keep keep keep keep
<mask> github.com/sirupsen/logrus v1.7.0 // indirect <mask> github.com/spf13/cobra v1.1.1 // indirect <mask> github.com/stretchr/testify v1.6.1 <mask> github.com/u-root/u-root v7.0.0+incompatible <mask> go.etcd.io/bbolt v1.3.5 <mask> golang.org/x/crypto v0.0.0-20201217014255-9d1352758620 <mask> golang.org/x/net v0.0.0-20201216054612-986b41b23924 <mask> golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 // indirect <mask> golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add github.com/digineo/go-ipset/v2 v2.2.1 </s> add github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be </s> add github.com/ti-mo/netfilter v0.2.0/go.mod h1:8GbBGsY/8fxtyIdfwy29JiluNcPK4K7wIT+x42ipqUU= github.com/ti-mo/netfilter v0.4.0 h1:rTN1nBYULDmMfDeBHZpKuNKX/bWEXQUhe02a/10orzg= github.com/ti-mo/netfilter v0.4.0/go.mod h1:V54q75mUx8CNA2JnFl+wv9iZ5+JP9nCcRlaFS5OZSRM= </s> add golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= </s> add golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= </s> add golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.mod
keep keep add keep keep keep keep
<mask> github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= <mask> github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= <mask> github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= <mask> github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= <mask> github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= <mask> github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= <mask> github.com/fanliao/go-promise v0.0.0-20141029170127-1890db352a72/go.mod h1:PjfxuH4FZdUyfMdtBio2lsRr1AKEaVPwelzuHuh8Lqc= </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add github.com/mdlayher/netlink v1.1.1 h1:VqG+Voq9V4uZ+04vjIrcSCWDpf91B1xxbP4QBUmUJE8= </s> add github.com/mdlayher/netlink v0.0.0-20190313131330-258ea9dff42c/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= </s> add github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be h1:7JeFwhE5SIdgKRd0qnqjOYJxY8AML8x/j+/qvFZ8R+c= github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be/go.mod h1:WTYpFb/WTvlRJAyKhZL5/uy69TDDpHHu2VZmb2XgV7o= </s> remove err := s.prepareUpstreamSettings() </s> add err = s.prepareUpstreamSettings() </s> remove s.ipset.init(s.conf.IPSETList) </s> add err := s.ipset.init(s.conf.IPSETList) if err != nil { return err } </s> add err := s.ipset.Close() if err != nil { log.Error("closing ipset: %s", err) }
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
keep add keep keep keep keep keep keep
<mask> github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ= <mask> github.com/jsimonetti/rtnetlink v0.0.0-20201009170750-9c6f07d100c1/go.mod h1:hqoO/u39cqLeBLebZ8fWdE96O7FxrAsRYhnVOdgHxok= <mask> github.com/jsimonetti/rtnetlink v0.0.0-20201110080708-d2c240429e6c/go.mod h1:huN4d1phzjhlOsNIjFsw2SVRbwIHj3fJDMEU2SDPTmg= <mask> github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= <mask> github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= <mask> github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= <mask> github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= <mask> github.com/kardianos/service v1.2.0 h1:bGuZ/epo3vrt8IPC7mnKQolqFeYJb7Cs8Rk4PSOBB/g= </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be </s> add github.com/ti-mo/netfilter v0.2.0/go.mod h1:8GbBGsY/8fxtyIdfwy29JiluNcPK4K7wIT+x42ipqUU= github.com/ti-mo/netfilter v0.4.0 h1:rTN1nBYULDmMfDeBHZpKuNKX/bWEXQUhe02a/10orzg= github.com/ti-mo/netfilter v0.4.0/go.mod h1:V54q75mUx8CNA2JnFl+wv9iZ5+JP9nCcRlaFS5OZSRM= </s> remove err := s.prepareUpstreamSettings() </s> add err = s.prepareUpstreamSettings() </s> remove s.ipset.init(s.conf.IPSETList) </s> add err := s.ipset.init(s.conf.IPSETList) if err != nil { return err } </s> add err := s.ipset.Close() if err != nil { log.Error("closing ipset: %s", err) } </s> add golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
keep add keep keep keep keep keep keep
<mask> github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 h1:lez6TS6aAau+8wXUP3G9I3TGlmPFEq2CTxBaRqY6AGE= <mask> github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7/go.mod h1:U6ZQobyTjI/tJyq2HG+i/dfSoFUt8/aZCM+GKtmFk/Y= <mask> github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= <mask> github.com/mdlayher/netlink v1.0.0/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= <mask> github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY= <mask> github.com/mdlayher/netlink v1.1.1 h1:VqG+Voq9V4uZ+04vjIrcSCWDpf91B1xxbP4QBUmUJE8= <mask> github.com/mdlayher/netlink v1.1.1/go.mod h1:WTYpFb/WTvlRJAyKhZL5/uy69TDDpHHu2VZmb2XgV7o= <mask> github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be h1:7JeFwhE5SIdgKRd0qnqjOYJxY8AML8x/j+/qvFZ8R+c= </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add github.com/mdlayher/netlink v1.1.1 h1:VqG+Voq9V4uZ+04vjIrcSCWDpf91B1xxbP4QBUmUJE8= </s> add github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be h1:7JeFwhE5SIdgKRd0qnqjOYJxY8AML8x/j+/qvFZ8R+c= github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be/go.mod h1:WTYpFb/WTvlRJAyKhZL5/uy69TDDpHHu2VZmb2XgV7o= </s> add github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be </s> add github.com/digineo/go-ipset/v2 v2.2.1 h1:k6skY+0fMqeUjjeWO/m5OuWPSZUAn7AucHMnQ1MX77g= github.com/digineo/go-ipset/v2 v2.2.1/go.mod h1:wBsNzJlZlABHUITkesrggFnZQtgW5wkqw1uo8Qxe0VU= </s> add github.com/digineo/go-ipset/v2 v2.2.1 </s> add github.com/ti-mo/netfilter v0.4.0
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
keep keep add keep keep keep keep
<mask> github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= <mask> github.com/mdlayher/netlink v1.0.0/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= <mask> github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY= <mask> github.com/mdlayher/netlink v1.1.1/go.mod h1:WTYpFb/WTvlRJAyKhZL5/uy69TDDpHHu2VZmb2XgV7o= <mask> github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be h1:7JeFwhE5SIdgKRd0qnqjOYJxY8AML8x/j+/qvFZ8R+c= <mask> github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be/go.mod h1:WTYpFb/WTvlRJAyKhZL5/uy69TDDpHHu2VZmb2XgV7o= <mask> github.com/mdlayher/raw v0.0.0-20190606142536-fef19f00fc18/go.mod h1:7EpbotpCmVZcu+KCX4g9WaRNuu11uyhiW7+Le1dKawg= </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be h1:7JeFwhE5SIdgKRd0qnqjOYJxY8AML8x/j+/qvFZ8R+c= github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be/go.mod h1:WTYpFb/WTvlRJAyKhZL5/uy69TDDpHHu2VZmb2XgV7o= </s> add github.com/mdlayher/netlink v0.0.0-20190313131330-258ea9dff42c/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= </s> add github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be </s> add github.com/digineo/go-ipset/v2 v2.2.1 h1:k6skY+0fMqeUjjeWO/m5OuWPSZUAn7AucHMnQ1MX77g= github.com/digineo/go-ipset/v2 v2.2.1/go.mod h1:wBsNzJlZlABHUITkesrggFnZQtgW5wkqw1uo8Qxe0VU= </s> remove err := s.prepareUpstreamSettings() </s> add err = s.prepareUpstreamSettings() </s> remove s.ipset.init(s.conf.IPSETList) </s> add err := s.ipset.init(s.conf.IPSETList) if err != nil { return err }
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
keep keep add keep keep keep keep
<mask> github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY= <mask> github.com/mdlayher/netlink v1.1.1 h1:VqG+Voq9V4uZ+04vjIrcSCWDpf91B1xxbP4QBUmUJE8= <mask> github.com/mdlayher/netlink v1.1.1/go.mod h1:WTYpFb/WTvlRJAyKhZL5/uy69TDDpHHu2VZmb2XgV7o= <mask> github.com/mdlayher/raw v0.0.0-20190606142536-fef19f00fc18/go.mod h1:7EpbotpCmVZcu+KCX4g9WaRNuu11uyhiW7+Le1dKawg= <mask> github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065 h1:aFkJ6lx4FPip+S+Uw4aTegFMct9shDvP+79PsSxpm3w= <mask> github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065/go.mod h1:7EpbotpCmVZcu+KCX4g9WaRNuu11uyhiW7+Le1dKawg= <mask> github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add github.com/mdlayher/netlink v1.1.1 h1:VqG+Voq9V4uZ+04vjIrcSCWDpf91B1xxbP4QBUmUJE8= </s> add github.com/mdlayher/netlink v0.0.0-20190313131330-258ea9dff42c/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= </s> add github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be </s> add github.com/digineo/go-ipset/v2 v2.2.1 h1:k6skY+0fMqeUjjeWO/m5OuWPSZUAn7AucHMnQ1MX77g= github.com/digineo/go-ipset/v2 v2.2.1/go.mod h1:wBsNzJlZlABHUITkesrggFnZQtgW5wkqw1uo8Qxe0VU= </s> add github.com/digineo/go-ipset/v2 v2.2.1 </s> add github.com/ti-mo/netfilter v0.4.0
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
keep keep keep add keep keep keep keep keep keep
<mask> github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= <mask> github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= <mask> github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= <mask> github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= <mask> github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= <mask> github.com/u-root/u-root v7.0.0+incompatible h1:u+KSS04pSxJGI5E7WE4Bs9+Zd75QjFv+REkjy/aoAc8= <mask> github.com/u-root/u-root v7.0.0+incompatible/go.mod h1:RYkpo8pTHrNjW08opNd/U6p/RJE7K0D8fXO0d47+3YY= <mask> github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= <mask> github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= <mask> github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add github.com/ti-mo/netfilter v0.4.0 </s> add github.com/jsimonetti/rtnetlink v0.0.0-20201110080708-d2c240429e6c h1:7cpGGTQO6+OuYQWkueqeXuErSjs1NZtpALpv1x7Mq4g= </s> remove err := s.prepareUpstreamSettings() </s> add err = s.prepareUpstreamSettings() </s> remove s.ipset.init(s.conf.IPSETList) </s> add err := s.ipset.init(s.conf.IPSETList) if err != nil { return err } </s> add err := s.ipset.Close() if err != nil { log.Error("closing ipset: %s", err) } </s> add golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
keep add keep keep keep keep
<mask> golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= <mask> golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= <mask> golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= <mask> golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= <mask> golang.org/x/net v0.0.0-20201209123823-ac852fbbde11 h1:lwlPPsmjDKK0J6eG6xDWd5XPehI0R024zxjDnw3esPA= <mask> golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add github.com/ti-mo/netfilter v0.4.0 </s> remove err := s.prepareUpstreamSettings() </s> add err = s.prepareUpstreamSettings() </s> remove s.ipset.init(s.conf.IPSETList) </s> add err := s.ipset.init(s.conf.IPSETList) if err != nil { return err } </s> add err := s.ipset.Close() if err != nil { log.Error("closing ipset: %s", err) } </s> add golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= </s> add golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
keep keep add keep keep keep keep keep keep
<mask> golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= <mask> golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20190411185658-b44545bcd369/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20190418153312-f0ce4c0180be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= </s> add github.com/ti-mo/netfilter v0.4.0 </s> remove err := s.prepareUpstreamSettings() </s> add err = s.prepareUpstreamSettings() </s> remove s.ipset.init(s.conf.IPSETList) </s> add err := s.ipset.init(s.conf.IPSETList) if err != nil { return err } </s> add err := s.ipset.Close() if err != nil { log.Error("closing ipset: %s", err) } </s> add golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
keep keep add keep keep keep keep keep keep
<mask> golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20201112073958-5cba982894dd h1:5CtCZbICpIOFdgO940moixOPjc0178IU44m4EjOO5IY= <mask> golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= <mask> golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20201214095126-aec9a390925b h1:tv7/y4pd+sR8bcNb2D6o7BNU6zjWm0VjQLac+w7fNNM= </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= </s> add github.com/ti-mo/netfilter v0.4.0 </s> remove err := s.prepareUpstreamSettings() </s> add err = s.prepareUpstreamSettings() </s> remove s.ipset.init(s.conf.IPSETList) </s> add err := s.ipset.init(s.conf.IPSETList) if err != nil { return err } </s> add err := s.ipset.Close() if err != nil { log.Error("closing ipset: %s", err) } </s> add golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
keep keep add keep keep keep keep keep
<mask> s.stats = nil <mask> s.queryLog = nil <mask> s.dnsProxy = nil <mask> s.Unlock() <mask> } <mask> <mask> // WriteDiskConfig - write configuration <mask> func (s *Server) WriteDiskConfig(c *FilteringConfig) { </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> remove err := s.prepareUpstreamSettings() </s> add err = s.prepareUpstreamSettings() </s> remove s.ipset.init(s.conf.IPSETList) </s> add err := s.ipset.init(s.conf.IPSETList) if err != nil { return err } </s> add github.com/ti-mo/netfilter v0.4.0 </s> add github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be </s> add github.com/digineo/go-ipset/v2 v2.2.1 </s> add golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
internal/dnsforward/dnsforward.go
keep keep keep keep replace keep keep keep replace
<mask> s.initDefaultSettings() <mask> <mask> // Initialize IPSET configuration <mask> // -- <mask> s.ipset.init(s.conf.IPSETList) <mask> <mask> // Prepare DNS servers settings <mask> // -- <mask> err := s.prepareUpstreamSettings() </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomains to master Closes #2179. Squashed commit of the following: commit de17caac4c2ea2bc7931f162c6dfa7822a71554f Author: Ainar Garipov <[email protected]> Date: Fri Jan 29 18:34:46 2021 +0300 dnsforward: imp code, docs commit e5ab957560bcfba80feac4b72f9b22535ecd4c7d Author: Ainar Garipov <[email protected]> Date: Tue Jan 26 20:43:31 2021 +0300 dnsforward: imp code commit 2b84d27b752832885e4896d0e75de2576e2b965b Author: David Sheets <[email protected]> Date: Tue Oct 6 16:34:06 2020 +0100 dnsforward: support subdomain matching in ipset This is a squash of all commits in #2179. </s> add err := s.ipset.Close() if err != nil { log.Error("closing ipset: %s", err) } </s> add github.com/ti-mo/netfilter v0.4.0 </s> add github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be </s> add github.com/digineo/go-ipset/v2 v2.2.1 </s> add golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
internal/dnsforward/dnsforward.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr" <mask> ) <mask> <mask> // ipRange is an inclusive range of IP addresses. <mask> // <mask> // It is safe for concurrent use. <mask> // <mask> // TODO(a.garipov): Perhaps create an optimised version with uint32 for <mask> // IPv4 ranges? Or use one of uint128 packages? </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> add // TODO(a.garipov): Don't use a disabled server in other places or just // use an interface. </s> add // defaultHwAddrLen is the default length of a hardware (MAC) address. const defaultHwAddrLen = 6 </s> add if r == nil { return 0, false } </s> remove // containsInt returns true if r contains ipInt. </s> add // containsInt returns true if r contains ipInt. For internal use only. </s> remove HWAddr: make([]byte, 6), </s> add HWAddr: make([]byte, len(mac)), </s> remove s.leasedOffsets.Set(uint(offset)) </s> add s.leasedOffsets.Set(offset)
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/iprange.go
keep keep add keep keep keep keep keep keep
<mask> <mask> // contains returns true if r contains ip. <mask> func (r *ipRange) contains(ip net.IP) (ok bool) { <mask> ipInt := (&big.Int{}).SetBytes(ip.To16()) <mask> <mask> return r.containsInt(ipInt) <mask> } <mask> <mask> // containsInt returns true if r contains ipInt. For internal use only. </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> remove // containsInt returns true if r contains ipInt. </s> add // containsInt returns true if r contains ipInt. For internal use only. </s> add if r == nil { return 0, false } </s> add if r == nil { return nil } </s> remove s.blacklistLease(lease) </s> add s.blocklistLease(lease) </s> add // TODO(a.garipov): Don't use a disabled server in other places or just // use an interface. </s> remove HWAddr: make([]byte, 6), </s> add HWAddr: make([]byte, len(mac)),
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/iprange.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> return r.containsInt(ipInt) <mask> } <mask> <mask> // containsInt returns true if r contains ipInt. <mask> func (r *ipRange) containsInt(ipInt *big.Int) (ok bool) { <mask> return ipInt.Cmp(r.start) >= 0 && ipInt.Cmp(r.end) <= 0 <mask> } <mask> <mask> // ipPredicate is a function that is called on every IP address in </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> add if r == nil { return false } </s> add if r == nil { return 0, false } </s> add if r == nil { return nil } </s> add n := len(s.leases) if i >= n { // TODO(a.garipov): Better error handling. log.Debug("dhcpv4: can't remove lease at index %d: no such lease", i) return } </s> remove // ipRange is an inclusive range of IP addresses. </s> add // ipRange is an inclusive range of IP addresses. A nil range is a range that // doesn't contain any IP addresses. </s> add // defaultHwAddrLen is the default length of a hardware (MAC) address. const defaultHwAddrLen = 6
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/iprange.go
keep add keep keep keep keep
<mask> // 16-byte form. <mask> func (r *ipRange) find(p ipPredicate) (ip net.IP) { <mask> ip = make(net.IP, net.IPv6len) <mask> _1 := big.NewInt(1) <mask> for i := (&big.Int{}).Set(r.start); i.Cmp(r.end) <= 0; i.Add(i, _1) { <mask> i.FillBytes(ip) </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> add if r == nil { return 0, false } </s> add if r == nil { return false } </s> add n := len(s.leases) if i >= n { // TODO(a.garipov): Better error handling. log.Debug("dhcpv4: can't remove lease at index %d: no such lease", i) return } </s> remove // containsInt returns true if r contains ipInt. </s> add // containsInt returns true if r contains ipInt. For internal use only. </s> remove func (s *v4Server) blacklistLease(lease *Lease) { hw := make(net.HardwareAddr, 6) lease.HWAddr = hw lease.Hostname = "" lease.Expiry = time.Now().Add(s.conf.leaseTime) </s> add func (s *v4Server) blocklistLease(l *Lease) { l.HWAddr = make(net.HardwareAddr, defaultHwAddrLen) l.Hostname = "" l.Expiry = time.Now().Add(s.conf.leaseTime) </s> add // defaultHwAddrLen is the default length of a hardware (MAC) address. const defaultHwAddrLen = 6
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/iprange.go
keep keep keep add keep keep keep keep keep
<mask> <mask> // offset returns the offset of ip from the beginning of r. It returns 0 and <mask> // false if ip is not in r. <mask> func (r *ipRange) offset(ip net.IP) (offset uint, ok bool) { <mask> ip = ip.To16() <mask> ipInt := (&big.Int{}).SetBytes(ip) <mask> if !r.containsInt(ipInt) { <mask> return 0, false <mask> } </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> add if r == nil { return false } </s> add if r == nil { return nil } </s> remove // containsInt returns true if r contains ipInt. </s> add // containsInt returns true if r contains ipInt. For internal use only. </s> add // defaultHwAddrLen is the default length of a hardware (MAC) address. const defaultHwAddrLen = 6 </s> add n = len(s.leases) if n > 0 { s.leases = s.leases[:n-1] } </s> add n := len(s.leases) if i >= n { // TODO(a.garipov): Better error handling. log.Debug("dhcpv4: can't remove lease at index %d: no such lease", i) return }
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/iprange.go
keep add keep keep keep keep keep keep
<mask> } <mask> <mask> // Add the specified IP to the black list for a time period <mask> func (s *v4Server) blocklistLease(l *Lease) { <mask> l.HWAddr = make(net.HardwareAddr, defaultHwAddrLen) <mask> l.Hostname = "" <mask> l.Expiry = time.Now().Add(s.conf.leaseTime) <mask> } </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> remove func (s *v4Server) blacklistLease(lease *Lease) { hw := make(net.HardwareAddr, 6) lease.HWAddr = hw lease.Hostname = "" lease.Expiry = time.Now().Add(s.conf.leaseTime) </s> add func (s *v4Server) blocklistLease(l *Lease) { l.HWAddr = make(net.HardwareAddr, defaultHwAddrLen) l.Hostname = "" l.Expiry = time.Now().Add(s.conf.leaseTime) </s> remove HWAddr: make([]byte, 6), </s> add HWAddr: make([]byte, len(mac)), </s> add n := len(s.leases) if i >= n { // TODO(a.garipov): Better error handling. log.Debug("dhcpv4: can't remove lease at index %d: no such lease", i) return } </s> remove s.leasedOffsets.Set(uint(offset)) </s> add s.leasedOffsets.Set(offset) </s> add if r == nil { return 0, false } </s> add // TODO(a.garipov): Don't use a disabled server in other places or just // use an interface.
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> return nil <mask> } <mask> <mask> // Add the specified IP to the black list for a time period <mask> func (s *v4Server) blacklistLease(lease *Lease) { <mask> hw := make(net.HardwareAddr, 6) <mask> lease.HWAddr = hw <mask> lease.Hostname = "" <mask> lease.Expiry = time.Now().Add(s.conf.leaseTime) <mask> } <mask> <mask> // rmLeaseByIndex removes a lease by its index in the leases slice. <mask> func (s *v4Server) rmLeaseByIndex(i int) { <mask> l := s.leases[i] </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> add // defaultHwAddrLen is the default length of a hardware (MAC) address. const defaultHwAddrLen = 6 </s> add n := len(s.leases) if i >= n { // TODO(a.garipov): Better error handling. log.Debug("dhcpv4: can't remove lease at index %d: no such lease", i) return } </s> remove HWAddr: make([]byte, 6), </s> add HWAddr: make([]byte, len(mac)), </s> add if r == nil { return 0, false } </s> remove s.leasedOffsets.Set(uint(offset)) </s> add s.leasedOffsets.Set(offset) </s> add // TODO(a.garipov): Don't use a disabled server in other places or just // use an interface.
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
keep keep add keep keep keep keep keep
<mask> <mask> // rmLeaseByIndex removes a lease by its index in the leases slice. <mask> func (s *v4Server) rmLeaseByIndex(i int) { <mask> l := s.leases[i] <mask> s.leases = append(s.leases[:i], s.leases[i+1:]...) <mask> <mask> n = len(s.leases) <mask> if n > 0 { </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> add n = len(s.leases) if n > 0 { s.leases = s.leases[:n-1] } </s> remove func (s *v4Server) blacklistLease(lease *Lease) { hw := make(net.HardwareAddr, 6) lease.HWAddr = hw lease.Hostname = "" lease.Expiry = time.Now().Add(s.conf.leaseTime) </s> add func (s *v4Server) blocklistLease(l *Lease) { l.HWAddr = make(net.HardwareAddr, defaultHwAddrLen) l.Hostname = "" l.Expiry = time.Now().Add(s.conf.leaseTime) </s> remove HWAddr: make([]byte, 6), </s> add HWAddr: make([]byte, len(mac)), </s> add // defaultHwAddrLen is the default length of a hardware (MAC) address. const defaultHwAddrLen = 6 </s> add if r == nil { return 0, false } </s> remove s.leasedOffsets.Set(uint(offset)) </s> add s.leasedOffsets.Set(offset)
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
keep keep add keep keep keep keep keep keep
<mask> l := s.leases[i] <mask> s.leases = append(s.leases[:i], s.leases[i+1:]...) <mask> <mask> r := s.conf.ipRange <mask> offset, ok := r.offset(l.IP) <mask> if ok { <mask> s.leasedOffsets.Clear(offset) <mask> } <mask> </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> add n := len(s.leases) if i >= n { // TODO(a.garipov): Better error handling. log.Debug("dhcpv4: can't remove lease at index %d: no such lease", i) return } </s> add if r == nil { return 0, false } </s> remove func (s *v4Server) blacklistLease(lease *Lease) { hw := make(net.HardwareAddr, 6) lease.HWAddr = hw lease.Hostname = "" lease.Expiry = time.Now().Add(s.conf.leaseTime) </s> add func (s *v4Server) blocklistLease(l *Lease) { l.HWAddr = make(net.HardwareAddr, defaultHwAddrLen) l.Hostname = "" l.Expiry = time.Now().Add(s.conf.leaseTime) </s> add if r == nil { return nil } </s> add if r == nil { return false } </s> remove s.blacklistLease(lease) </s> add s.blocklistLease(lease)
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
keep keep keep keep replace keep keep keep keep keep
<mask> return <mask> } <mask> <mask> s.leases = append(s.leases, l) <mask> s.leasedOffsets.Set(uint(offset)) <mask> <mask> log.Debug("dhcpv4: added lease %s (%s)", l.IP, l.HWAddr) <mask> } <mask> <mask> // Remove a lease with the same properties </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> add n := len(s.leases) if i >= n { // TODO(a.garipov): Better error handling. log.Debug("dhcpv4: can't remove lease at index %d: no such lease", i) return } </s> remove func (s *v4Server) blacklistLease(lease *Lease) { hw := make(net.HardwareAddr, 6) lease.HWAddr = hw lease.Hostname = "" lease.Expiry = time.Now().Add(s.conf.leaseTime) </s> add func (s *v4Server) blocklistLease(l *Lease) { l.HWAddr = make(net.HardwareAddr, defaultHwAddrLen) l.Hostname = "" l.Expiry = time.Now().Add(s.conf.leaseTime) </s> add // defaultHwAddrLen is the default length of a hardware (MAC) address. const defaultHwAddrLen = 6 </s> add n = len(s.leases) if n > 0 { s.leases = s.leases[:n-1] } </s> remove s.blacklistLease(lease) </s> add s.blocklistLease(lease) </s> remove HWAddr: make([]byte, 6), </s> add HWAddr: make([]byte, len(mac)),
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
keep keep keep keep replace keep keep keep keep keep
<mask> // Shouldn't happen. <mask> return false <mask> } <mask> <mask> return !s.leasedOffsets.Test(uint(offset)) <mask> }) <mask> <mask> return ip.To4() <mask> } <mask> </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> add if r == nil { return 0, false } </s> add if r == nil { return false } </s> remove s.leasedOffsets.Set(uint(offset)) </s> add s.leasedOffsets.Set(offset) </s> remove // containsInt returns true if r contains ipInt. </s> add // containsInt returns true if r contains ipInt. For internal use only. </s> add // TODO(a.garipov): Don't use a disabled server in other places or just // use an interface. </s> add if r == nil { return nil }
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
keep keep keep keep replace keep keep keep keep keep
<mask> // reserveLease reserves a lease for a client by its MAC-address. It returns <mask> // nil if it couldn't allocate a new lease. <mask> func (s *v4Server) reserveLease(mac net.HardwareAddr) (l *Lease) { <mask> l = &Lease{ <mask> HWAddr: make([]byte, 6), <mask> } <mask> <mask> copy(l.HWAddr, mac) <mask> <mask> l.IP = s.nextIP() </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> remove func (s *v4Server) blacklistLease(lease *Lease) { hw := make(net.HardwareAddr, 6) lease.HWAddr = hw lease.Hostname = "" lease.Expiry = time.Now().Add(s.conf.leaseTime) </s> add func (s *v4Server) blocklistLease(l *Lease) { l.HWAddr = make(net.HardwareAddr, defaultHwAddrLen) l.Hostname = "" l.Expiry = time.Now().Add(s.conf.leaseTime) </s> add n := len(s.leases) if i >= n { // TODO(a.garipov): Better error handling. log.Debug("dhcpv4: can't remove lease at index %d: no such lease", i) return } </s> add // defaultHwAddrLen is the default length of a hardware (MAC) address. const defaultHwAddrLen = 6 </s> add if r == nil { return 0, false } </s> add // TODO(a.garipov): Don't use a disabled server in other places or just // use an interface. </s> remove // containsInt returns true if r contains ipInt. </s> add // containsInt returns true if r contains ipInt. For internal use only.
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> toStore = true <mask> <mask> if !s.addrAvailable(lease.IP) { <mask> s.blacklistLease(lease) <mask> lease = nil <mask> continue <mask> } <mask> break <mask> } </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> add if r == nil { return false } </s> add n = len(s.leases) if n > 0 { s.leases = s.leases[:n-1] } </s> add // TODO(a.garipov): Don't use a disabled server in other places or just // use an interface. </s> remove func (s *v4Server) blacklistLease(lease *Lease) { hw := make(net.HardwareAddr, 6) lease.HWAddr = hw lease.Hostname = "" lease.Expiry = time.Now().Add(s.conf.leaseTime) </s> add func (s *v4Server) blocklistLease(l *Lease) { l.HWAddr = make(net.HardwareAddr, defaultHwAddrLen) l.Hostname = "" l.Expiry = time.Now().Add(s.conf.leaseTime) </s> remove HWAddr: make([]byte, 6), </s> add HWAddr: make([]byte, len(mac)), </s> add n := len(s.leases) if i >= n { // TODO(a.garipov): Better error handling. log.Debug("dhcpv4: can't remove lease at index %d: no such lease", i) return }
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
keep add keep keep keep keep keep keep
<mask> s.conf = conf <mask> <mask> if !conf.Enabled { <mask> return s, nil <mask> } <mask> <mask> s.conf.routerIP, err = tryTo4(s.conf.GatewayIP) <mask> if err != nil { </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b5866213e017405aa2cf8a6ee2f24 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:51:43 2021 +0300 all: doc changes; imp naming commit f036b50a60ba030aa6866944fc7a7b8776ce01d4 Author: Ainar Garipov <[email protected]> Date: Wed Mar 17 14:09:19 2021 +0300 dhcpd: fix static leases </s> remove s.blacklistLease(lease) </s> add s.blocklistLease(lease) </s> add if r == nil { return nil } </s> add if r == nil { return 0, false } </s> add n = len(s.leases) if n > 0 { s.leases = s.leases[:n-1] } </s> add if r == nil { return false } </s> remove func (s *v4Server) blacklistLease(lease *Lease) { hw := make(net.HardwareAddr, 6) lease.HWAddr = hw lease.Hostname = "" lease.Expiry = time.Now().Add(s.conf.leaseTime) </s> add func (s *v4Server) blocklistLease(l *Lease) { l.HWAddr = make(net.HardwareAddr, defaultHwAddrLen) l.Hostname = "" l.Expiry = time.Now().Add(s.conf.leaseTime)
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> // wrapErrs is a helper to wrap the errors from two independent underlying <mask> // connections. <mask> func (c *dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) { <mask> switch { <mask> case udpConnErr != nil && rawConnErr != nil: <mask> return errors.List(fmt.Sprintf("%s both connections", action), udpConnErr, rawConnErr) <mask> case udpConnErr != nil: <mask> return fmt.Errorf("%s udp connection: %w", action, udpConnErr) </s> Pull request: 4337 increase msg size Merge in DNS/adguard-home from 4337-dhcp-msg-len to master Updates #4337. Squashed commit of the following: commit 55e53c1fadd4ccb2a8b94117afff82e9a5d2734b Merge: f37070ea da1ae338 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 14:14:21 2022 +0300 Merge branch 'master' into 4337-dhcp-msg-len commit f37070ea0f3a7ff8efcbbafd36001f78d9b082b5 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 13:15:25 2022 +0300 dhcpd: imp ether pkt building commit fa43a0bcc24d4ca5e9193899dbba8495f3de5df9 Author: Eugene Burkov <[email protected]> Date: Tue Sep 6 18:55:07 2022 +0300 dhcpd: incr msg size </s> remove return 0, fmt.Errorf("peer is of unexpected type %T", addr) </s> add return 0, fmt.Errorf("addr has an unexpected type %T", addr) </s> remove dhcpLayer := gopacket.NewPacket(payload, layers.LayerTypeDHCPv4, gopacket.DecodeOptions{ NoCopy: true, }).Layer(layers.LayerTypeDHCPv4) // Check if the decoding succeeded and the resulting layer doesn't // contain any errors. It should guarantee panic-safe converting of the // layer into gopacket.SerializableLayer. if dhcpLayer == nil || dhcpLayer.LayerType() != layers.LayerTypeDHCPv4 { return nil, errInvalidPktDHCP } </s> add </s> remove // errInvalidPktDHCP is returned when the provided payload is not a valid DHCP // packet. const errInvalidPktDHCP errors.Error = "packet is not a valid dhcp packet" // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. The // payload is expected to be an encoded DHCP packet. </s> add // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. // Validation of the payload is a caller's responsibility. </s> add // minDHCPMsgSize is the minimum length of the encoded DHCP message in bytes // according to RFC-2131. // // See https://datatracker.ietf.org/doc/html/rfc2131#section-2. const minDHCPMsgSize = 576 </s> remove log.Debug("dhcpv4: sending to %s: %s", peer, resp.Summary()) if _, err := conn.WriteTo(resp.ToBytes(), peer); err != nil { </s> add pktData := resp.ToBytes() pktLen := len(pktData) if pktLen < minDHCPMsgSize { // Expand the packet to match the minimum DHCP message length. Although // the dhpcv4 package deals with the BOOTP's lower packet length // constraint, it seems some clients expecting the length being at least // 576 bytes as per RFC 2131 (and an obsolete RFC 1533). // // See https://github.com/AdguardTeam/AdGuardHome/issues/4337. pktData = append(pktData, make([]byte, minDHCPMsgSize-pktLen)...) } log.Debug("dhcpv4: sending %d bytes to %s: %s", len(pktData), peer, resp.Summary()) _, err := conn.WriteTo(pktData, peer) if err != nil { </s> remove }, ethLayer, ipv4Layer, udpLayer, dhcpLayer.(gopacket.SerializableLayer)) </s> add } err = gopacket.SerializeLayers( buf, setts, ethLayer, ipv4Layer, udpLayer, gopacket.Payload(payload), )
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix.go
keep keep keep keep replace keep keep keep keep keep
<mask> // Unicast the message to the client's IP address. Use the UDP <mask> // connection. <mask> return c.udpConn.WriteTo(p, addr) <mask> default: <mask> return 0, fmt.Errorf("peer is of unexpected type %T", addr) <mask> } <mask> } <mask> <mask> // ReadFrom implements net.PacketConn for *dhcpConn. <mask> func (c *dhcpConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) { </s> Pull request: 4337 increase msg size Merge in DNS/adguard-home from 4337-dhcp-msg-len to master Updates #4337. Squashed commit of the following: commit 55e53c1fadd4ccb2a8b94117afff82e9a5d2734b Merge: f37070ea da1ae338 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 14:14:21 2022 +0300 Merge branch 'master' into 4337-dhcp-msg-len commit f37070ea0f3a7ff8efcbbafd36001f78d9b082b5 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 13:15:25 2022 +0300 dhcpd: imp ether pkt building commit fa43a0bcc24d4ca5e9193899dbba8495f3de5df9 Author: Eugene Burkov <[email protected]> Date: Tue Sep 6 18:55:07 2022 +0300 dhcpd: incr msg size </s> add // minDHCPMsgSize is the minimum length of the encoded DHCP message in bytes // according to RFC-2131. // // See https://datatracker.ietf.org/doc/html/rfc2131#section-2. const minDHCPMsgSize = 576 </s> remove dhcpLayer := gopacket.NewPacket(payload, layers.LayerTypeDHCPv4, gopacket.DecodeOptions{ NoCopy: true, }).Layer(layers.LayerTypeDHCPv4) // Check if the decoding succeeded and the resulting layer doesn't // contain any errors. It should guarantee panic-safe converting of the // layer into gopacket.SerializableLayer. if dhcpLayer == nil || dhcpLayer.LayerType() != layers.LayerTypeDHCPv4 { return nil, errInvalidPktDHCP } </s> add </s> remove // errInvalidPktDHCP is returned when the provided payload is not a valid DHCP // packet. const errInvalidPktDHCP errors.Error = "packet is not a valid dhcp packet" // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. The // payload is expected to be an encoded DHCP packet. </s> add // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. // Validation of the payload is a caller's responsibility. </s> remove log.Debug("dhcpv4: sending to %s: %s", peer, resp.Summary()) if _, err := conn.WriteTo(resp.ToBytes(), peer); err != nil { </s> add pktData := resp.ToBytes() pktLen := len(pktData) if pktLen < minDHCPMsgSize { // Expand the packet to match the minimum DHCP message length. Although // the dhpcv4 package deals with the BOOTP's lower packet length // constraint, it seems some clients expecting the length being at least // 576 bytes as per RFC 2131 (and an obsolete RFC 1533). // // See https://github.com/AdguardTeam/AdGuardHome/issues/4337. pktData = append(pktData, make([]byte, minDHCPMsgSize-pktLen)...) } log.Debug("dhcpv4: sending %d bytes to %s: %s", len(pktData), peer, resp.Summary()) _, err := conn.WriteTo(pktData, peer) if err != nil { </s> remove func (c *dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) { </s> add func (*dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) { </s> remove testutil.AssertErrorMsg(t, "peer is of unexpected type *dhcpd.unexpectedAddrType", err) </s> add testutil.AssertErrorMsg(t, "addr has an unexpected type *dhcpd.unexpectedAddrType", err)
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix.go
keep keep keep keep replace replace keep keep replace replace replace replace replace replace keep keep
<mask> c.rawConn.SetWriteDeadline(t), <mask> ) <mask> } <mask> <mask> // ipv4DefaultTTL is the default Time to Live value as recommended by <mask> // RFC-1700 (https://datatracker.ietf.org/doc/html/rfc1700) in seconds. <mask> const ipv4DefaultTTL = 64 <mask> <mask> // errInvalidPktDHCP is returned when the provided payload is not a valid DHCP <mask> // packet. <mask> const errInvalidPktDHCP errors.Error = "packet is not a valid dhcp packet" <mask> <mask> // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. The <mask> // payload is expected to be an encoded DHCP packet. <mask> func (c *dhcpConn) buildEtherPkt(payload []byte, peer *dhcpUnicastAddr) (pkt []byte, err error) { <mask> dhcpLayer := gopacket.NewPacket(payload, layers.LayerTypeDHCPv4, gopacket.DecodeOptions{ </s> Pull request: 4337 increase msg size Merge in DNS/adguard-home from 4337-dhcp-msg-len to master Updates #4337. Squashed commit of the following: commit 55e53c1fadd4ccb2a8b94117afff82e9a5d2734b Merge: f37070ea da1ae338 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 14:14:21 2022 +0300 Merge branch 'master' into 4337-dhcp-msg-len commit f37070ea0f3a7ff8efcbbafd36001f78d9b082b5 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 13:15:25 2022 +0300 dhcpd: imp ether pkt building commit fa43a0bcc24d4ca5e9193899dbba8495f3de5df9 Author: Eugene Burkov <[email protected]> Date: Tue Sep 6 18:55:07 2022 +0300 dhcpd: incr msg size </s> remove dhcpLayer := gopacket.NewPacket(payload, layers.LayerTypeDHCPv4, gopacket.DecodeOptions{ NoCopy: true, }).Layer(layers.LayerTypeDHCPv4) // Check if the decoding succeeded and the resulting layer doesn't // contain any errors. It should guarantee panic-safe converting of the // layer into gopacket.SerializableLayer. if dhcpLayer == nil || dhcpLayer.LayerType() != layers.LayerTypeDHCPv4 { return nil, errInvalidPktDHCP } </s> add </s> add // minDHCPMsgSize is the minimum length of the encoded DHCP message in bytes // according to RFC-2131. // // See https://datatracker.ietf.org/doc/html/rfc2131#section-2. const minDHCPMsgSize = 576 </s> remove return 0, fmt.Errorf("peer is of unexpected type %T", addr) </s> add return 0, fmt.Errorf("addr has an unexpected type %T", addr) </s> remove log.Debug("dhcpv4: sending to %s: %s", peer, resp.Summary()) if _, err := conn.WriteTo(resp.ToBytes(), peer); err != nil { </s> add pktData := resp.ToBytes() pktLen := len(pktData) if pktLen < minDHCPMsgSize { // Expand the packet to match the minimum DHCP message length. Although // the dhpcv4 package deals with the BOOTP's lower packet length // constraint, it seems some clients expecting the length being at least // 576 bytes as per RFC 2131 (and an obsolete RFC 1533). // // See https://github.com/AdguardTeam/AdGuardHome/issues/4337. pktData = append(pktData, make([]byte, minDHCPMsgSize-pktLen)...) } log.Debug("dhcpv4: sending %d bytes to %s: %s", len(pktData), peer, resp.Summary()) _, err := conn.WriteTo(pktData, peer) if err != nil { </s> remove func (c *dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) { </s> add func (*dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) {
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix.go
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> <mask> // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. The <mask> // payload is expected to be an encoded DHCP packet. <mask> func (c *dhcpConn) buildEtherPkt(payload []byte, peer *dhcpUnicastAddr) (pkt []byte, err error) { <mask> dhcpLayer := gopacket.NewPacket(payload, layers.LayerTypeDHCPv4, gopacket.DecodeOptions{ <mask> NoCopy: true, <mask> }).Layer(layers.LayerTypeDHCPv4) <mask> <mask> // Check if the decoding succeeded and the resulting layer doesn't <mask> // contain any errors. It should guarantee panic-safe converting of the <mask> // layer into gopacket.SerializableLayer. <mask> if dhcpLayer == nil || dhcpLayer.LayerType() != layers.LayerTypeDHCPv4 { <mask> return nil, errInvalidPktDHCP <mask> } <mask> <mask> udpLayer := &layers.UDP{ <mask> SrcPort: dhcpv4.ServerPort, <mask> DstPort: dhcpv4.ClientPort, <mask> } <mask> ipv4Layer := &layers.IPv4{ </s> Pull request: 4337 increase msg size Merge in DNS/adguard-home from 4337-dhcp-msg-len to master Updates #4337. Squashed commit of the following: commit 55e53c1fadd4ccb2a8b94117afff82e9a5d2734b Merge: f37070ea da1ae338 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 14:14:21 2022 +0300 Merge branch 'master' into 4337-dhcp-msg-len commit f37070ea0f3a7ff8efcbbafd36001f78d9b082b5 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 13:15:25 2022 +0300 dhcpd: imp ether pkt building commit fa43a0bcc24d4ca5e9193899dbba8495f3de5df9 Author: Eugene Burkov <[email protected]> Date: Tue Sep 6 18:55:07 2022 +0300 dhcpd: incr msg size </s> remove // errInvalidPktDHCP is returned when the provided payload is not a valid DHCP // packet. const errInvalidPktDHCP errors.Error = "packet is not a valid dhcp packet" // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. The // payload is expected to be an encoded DHCP packet. </s> add // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. // Validation of the payload is a caller's responsibility. </s> remove log.Debug("dhcpv4: sending to %s: %s", peer, resp.Summary()) if _, err := conn.WriteTo(resp.ToBytes(), peer); err != nil { </s> add pktData := resp.ToBytes() pktLen := len(pktData) if pktLen < minDHCPMsgSize { // Expand the packet to match the minimum DHCP message length. Although // the dhpcv4 package deals with the BOOTP's lower packet length // constraint, it seems some clients expecting the length being at least // 576 bytes as per RFC 2131 (and an obsolete RFC 1533). // // See https://github.com/AdguardTeam/AdGuardHome/issues/4337. pktData = append(pktData, make([]byte, minDHCPMsgSize-pktLen)...) } log.Debug("dhcpv4: sending %d bytes to %s: %s", len(pktData), peer, resp.Summary()) _, err := conn.WriteTo(pktData, peer) if err != nil { </s> remove return 0, fmt.Errorf("peer is of unexpected type %T", addr) </s> add return 0, fmt.Errorf("addr has an unexpected type %T", addr) </s> add // minDHCPMsgSize is the minimum length of the encoded DHCP message in bytes // according to RFC-2131. // // See https://datatracker.ietf.org/doc/html/rfc2131#section-2. const minDHCPMsgSize = 576 </s> remove // ipv4DefaultTTL is the default Time to Live value as recommended by // RFC-1700 (https://datatracker.ietf.org/doc/html/rfc1700) in seconds. </s> add // ipv4DefaultTTL is the default Time to Live value in seconds as recommended by // RFC-1700. // // See https://datatracker.ietf.org/doc/html/rfc1700. </s> remove func (c *dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) { </s> add func (*dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) {
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix.go
keep keep keep keep replace keep keep replace keep keep keep keep
<mask> EthernetType: layers.EthernetTypeIPv4, <mask> } <mask> <mask> buf := gopacket.NewSerializeBuffer() <mask> err = gopacket.SerializeLayers(buf, gopacket.SerializeOptions{ <mask> FixLengths: true, <mask> ComputeChecksums: true, <mask> }, ethLayer, ipv4Layer, udpLayer, dhcpLayer.(gopacket.SerializableLayer)) <mask> if err != nil { <mask> return nil, fmt.Errorf("serializing layers: %w", err) <mask> } <mask> </s> Pull request: 4337 increase msg size Merge in DNS/adguard-home from 4337-dhcp-msg-len to master Updates #4337. Squashed commit of the following: commit 55e53c1fadd4ccb2a8b94117afff82e9a5d2734b Merge: f37070ea da1ae338 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 14:14:21 2022 +0300 Merge branch 'master' into 4337-dhcp-msg-len commit f37070ea0f3a7ff8efcbbafd36001f78d9b082b5 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 13:15:25 2022 +0300 dhcpd: imp ether pkt building commit fa43a0bcc24d4ca5e9193899dbba8495f3de5df9 Author: Eugene Burkov <[email protected]> Date: Tue Sep 6 18:55:07 2022 +0300 dhcpd: incr msg size </s> remove dhcpLayer := gopacket.NewPacket(payload, layers.LayerTypeDHCPv4, gopacket.DecodeOptions{ NoCopy: true, }).Layer(layers.LayerTypeDHCPv4) // Check if the decoding succeeded and the resulting layer doesn't // contain any errors. It should guarantee panic-safe converting of the // layer into gopacket.SerializableLayer. if dhcpLayer == nil || dhcpLayer.LayerType() != layers.LayerTypeDHCPv4 { return nil, errInvalidPktDHCP } </s> add </s> remove log.Debug("dhcpv4: sending to %s: %s", peer, resp.Summary()) if _, err := conn.WriteTo(resp.ToBytes(), peer); err != nil { </s> add pktData := resp.ToBytes() pktLen := len(pktData) if pktLen < minDHCPMsgSize { // Expand the packet to match the minimum DHCP message length. Although // the dhpcv4 package deals with the BOOTP's lower packet length // constraint, it seems some clients expecting the length being at least // 576 bytes as per RFC 2131 (and an obsolete RFC 1533). // // See https://github.com/AdguardTeam/AdGuardHome/issues/4337. pktData = append(pktData, make([]byte, minDHCPMsgSize-pktLen)...) } log.Debug("dhcpv4: sending %d bytes to %s: %s", len(pktData), peer, resp.Summary()) _, err := conn.WriteTo(pktData, peer) if err != nil { </s> remove func (c *dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) { </s> add func (*dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) { </s> remove testutil.AssertErrorMsg(t, "peer is of unexpected type *dhcpd.unexpectedAddrType", err) </s> add testutil.AssertErrorMsg(t, "addr has an unexpected type *dhcpd.unexpectedAddrType", err) </s> remove t.Run("non-serializable", func(t *testing.T) { </s> add t.Run("bad_payload", func(t *testing.T) {
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix.go
keep keep keep keep replace keep keep keep keep keep
<mask> conn := &dhcpConn{} <mask> n, err := conn.WriteTo(nil, &unexpectedAddrType{}) <mask> require.Error(t, err) <mask> <mask> testutil.AssertErrorMsg(t, "peer is of unexpected type *dhcpd.unexpectedAddrType", err) <mask> assert.Zero(t, n) <mask> }) <mask> } <mask> <mask> func TestBuildEtherPkt(t *testing.T) { </s> Pull request: 4337 increase msg size Merge in DNS/adguard-home from 4337-dhcp-msg-len to master Updates #4337. Squashed commit of the following: commit 55e53c1fadd4ccb2a8b94117afff82e9a5d2734b Merge: f37070ea da1ae338 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 14:14:21 2022 +0300 Merge branch 'master' into 4337-dhcp-msg-len commit f37070ea0f3a7ff8efcbbafd36001f78d9b082b5 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 13:15:25 2022 +0300 dhcpd: imp ether pkt building commit fa43a0bcc24d4ca5e9193899dbba8495f3de5df9 Author: Eugene Burkov <[email protected]> Date: Tue Sep 6 18:55:07 2022 +0300 dhcpd: incr msg size </s> remove t.Run("non-serializable", func(t *testing.T) { </s> add t.Run("bad_payload", func(t *testing.T) { </s> remove return 0, fmt.Errorf("peer is of unexpected type %T", addr) </s> add return 0, fmt.Errorf("addr has an unexpected type %T", addr) </s> remove pkt, err := conn.buildEtherPkt(invalidPayload, nil) require.Error(t, err) </s> add pkt, err := conn.buildEtherPkt(invalidPayload, peer) require.NoError(t, err) </s> remove assert.ErrorIs(t, err, errInvalidPktDHCP) assert.Empty(t, pkt) </s> add assert.NotEmpty(t, pkt) </s> add // minDHCPMsgSize is the minimum length of the encoded DHCP message in bytes // according to RFC-2131. // // See https://datatracker.ietf.org/doc/html/rfc2131#section-2. const minDHCPMsgSize = 576 </s> remove err = gopacket.SerializeLayers(buf, gopacket.SerializeOptions{ </s> add setts := gopacket.SerializeOptions{
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix_test.go
keep keep keep replace keep keep keep keep keep keep keep keep replace replace keep keep keep keep
<mask> } <mask> }) <mask> <mask> t.Run("non-serializable", func(t *testing.T) { <mask> // Create an invalid DHCP packet. <mask> invalidPayload := []byte{1, 2, 3, 4} <mask> pkt, err := conn.buildEtherPkt(invalidPayload, nil) <mask> require.Error(t, err) <mask> <mask> t.Run("non-serializable", func(t *testing.T) { <mask> // Create an invalid DHCP packet. <mask> invalidPayload := []byte{1, 2, 3, 4} <mask> pkt, err := conn.buildEtherPkt(invalidPayload, nil) <mask> require.Error(t, err) <mask> <mask> assert.ErrorIs(t, err, errInvalidPktDHCP) <mask> assert.Empty(t, pkt) <mask> }) </s> Pull request: 4337 increase msg size Merge in DNS/adguard-home from 4337-dhcp-msg-len to master Updates #4337. Squashed commit of the following: commit 55e53c1fadd4ccb2a8b94117afff82e9a5d2734b Merge: f37070ea da1ae338 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 14:14:21 2022 +0300 Merge branch 'master' into 4337-dhcp-msg-len commit f37070ea0f3a7ff8efcbbafd36001f78d9b082b5 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 13:15:25 2022 +0300 dhcpd: imp ether pkt building commit fa43a0bcc24d4ca5e9193899dbba8495f3de5df9 Author: Eugene Burkov <[email protected]> Date: Tue Sep 6 18:55:07 2022 +0300 dhcpd: incr msg size </s> remove assert.ErrorIs(t, err, errInvalidPktDHCP) assert.Empty(t, pkt) </s> add assert.NotEmpty(t, pkt) </s> remove testutil.AssertErrorMsg(t, "peer is of unexpected type *dhcpd.unexpectedAddrType", err) </s> add testutil.AssertErrorMsg(t, "addr has an unexpected type *dhcpd.unexpectedAddrType", err) </s> remove log.Debug("dhcpv4: sending to %s: %s", peer, resp.Summary()) if _, err := conn.WriteTo(resp.ToBytes(), peer); err != nil { </s> add pktData := resp.ToBytes() pktLen := len(pktData) if pktLen < minDHCPMsgSize { // Expand the packet to match the minimum DHCP message length. Although // the dhpcv4 package deals with the BOOTP's lower packet length // constraint, it seems some clients expecting the length being at least // 576 bytes as per RFC 2131 (and an obsolete RFC 1533). // // See https://github.com/AdguardTeam/AdGuardHome/issues/4337. pktData = append(pktData, make([]byte, minDHCPMsgSize-pktLen)...) } log.Debug("dhcpv4: sending %d bytes to %s: %s", len(pktData), peer, resp.Summary()) _, err := conn.WriteTo(pktData, peer) if err != nil { </s> remove dhcpLayer := gopacket.NewPacket(payload, layers.LayerTypeDHCPv4, gopacket.DecodeOptions{ NoCopy: true, }).Layer(layers.LayerTypeDHCPv4) // Check if the decoding succeeded and the resulting layer doesn't // contain any errors. It should guarantee panic-safe converting of the // layer into gopacket.SerializableLayer. if dhcpLayer == nil || dhcpLayer.LayerType() != layers.LayerTypeDHCPv4 { return nil, errInvalidPktDHCP } </s> add </s> remove err = gopacket.SerializeLayers(buf, gopacket.SerializeOptions{ </s> add setts := gopacket.SerializeOptions{
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix_test.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> invalidPayload := []byte{1, 2, 3, 4} <mask> pkt, err := conn.buildEtherPkt(invalidPayload, nil) <mask> require.Error(t, err) <mask> <mask> assert.ErrorIs(t, err, errInvalidPktDHCP) <mask> assert.Empty(t, pkt) <mask> }) <mask> <mask> t.Run("serializing_error", func(t *testing.T) { <mask> // Create a peer with invalid MAC. <mask> badPeer := &dhcpUnicastAddr{ </s> Pull request: 4337 increase msg size Merge in DNS/adguard-home from 4337-dhcp-msg-len to master Updates #4337. Squashed commit of the following: commit 55e53c1fadd4ccb2a8b94117afff82e9a5d2734b Merge: f37070ea da1ae338 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 14:14:21 2022 +0300 Merge branch 'master' into 4337-dhcp-msg-len commit f37070ea0f3a7ff8efcbbafd36001f78d9b082b5 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 13:15:25 2022 +0300 dhcpd: imp ether pkt building commit fa43a0bcc24d4ca5e9193899dbba8495f3de5df9 Author: Eugene Burkov <[email protected]> Date: Tue Sep 6 18:55:07 2022 +0300 dhcpd: incr msg size </s> remove pkt, err := conn.buildEtherPkt(invalidPayload, nil) require.Error(t, err) </s> add pkt, err := conn.buildEtherPkt(invalidPayload, peer) require.NoError(t, err) </s> remove t.Run("non-serializable", func(t *testing.T) { </s> add t.Run("bad_payload", func(t *testing.T) { </s> remove testutil.AssertErrorMsg(t, "peer is of unexpected type *dhcpd.unexpectedAddrType", err) </s> add testutil.AssertErrorMsg(t, "addr has an unexpected type *dhcpd.unexpectedAddrType", err) </s> remove log.Debug("dhcpv4: sending to %s: %s", peer, resp.Summary()) if _, err := conn.WriteTo(resp.ToBytes(), peer); err != nil { </s> add pktData := resp.ToBytes() pktLen := len(pktData) if pktLen < minDHCPMsgSize { // Expand the packet to match the minimum DHCP message length. Although // the dhpcv4 package deals with the BOOTP's lower packet length // constraint, it seems some clients expecting the length being at least // 576 bytes as per RFC 2131 (and an obsolete RFC 1533). // // See https://github.com/AdguardTeam/AdGuardHome/issues/4337. pktData = append(pktData, make([]byte, minDHCPMsgSize-pktLen)...) } log.Debug("dhcpv4: sending %d bytes to %s: %s", len(pktData), peer, resp.Summary()) _, err := conn.WriteTo(pktData, peer) if err != nil { </s> remove // errInvalidPktDHCP is returned when the provided payload is not a valid DHCP // packet. const errInvalidPktDHCP errors.Error = "packet is not a valid dhcp packet" // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. The // payload is expected to be an encoded DHCP packet. </s> add // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. // Validation of the payload is a caller's responsibility. </s> remove dhcpLayer := gopacket.NewPacket(payload, layers.LayerTypeDHCPv4, gopacket.DecodeOptions{ NoCopy: true, }).Layer(layers.LayerTypeDHCPv4) // Check if the decoding succeeded and the resulting layer doesn't // contain any errors. It should guarantee panic-safe converting of the // layer into gopacket.SerializableLayer. if dhcpLayer == nil || dhcpLayer.LayerType() != layers.LayerTypeDHCPv4 { return nil, errInvalidPktDHCP } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix_test.go
keep add keep keep keep keep keep keep
<mask> } <mask> <mask> // send writes resp for peer to conn considering the req's parameters according <mask> // to RFC-2131. <mask> // <mask> // See https://datatracker.ietf.org/doc/html/rfc2131#section-4.1. <mask> func (s *v4Server) send(peer net.Addr, conn net.PacketConn, req, resp *dhcpv4.DHCPv4) { <mask> switch giaddr, ciaddr, mtype := req.GatewayIPAddr, req.ClientIPAddr, resp.MessageType(); { </s> Pull request: 4337 increase msg size Merge in DNS/adguard-home from 4337-dhcp-msg-len to master Updates #4337. Squashed commit of the following: commit 55e53c1fadd4ccb2a8b94117afff82e9a5d2734b Merge: f37070ea da1ae338 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 14:14:21 2022 +0300 Merge branch 'master' into 4337-dhcp-msg-len commit f37070ea0f3a7ff8efcbbafd36001f78d9b082b5 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 13:15:25 2022 +0300 dhcpd: imp ether pkt building commit fa43a0bcc24d4ca5e9193899dbba8495f3de5df9 Author: Eugene Burkov <[email protected]> Date: Tue Sep 6 18:55:07 2022 +0300 dhcpd: incr msg size </s> remove return 0, fmt.Errorf("peer is of unexpected type %T", addr) </s> add return 0, fmt.Errorf("addr has an unexpected type %T", addr) </s> remove log.Debug("dhcpv4: sending to %s: %s", peer, resp.Summary()) if _, err := conn.WriteTo(resp.ToBytes(), peer); err != nil { </s> add pktData := resp.ToBytes() pktLen := len(pktData) if pktLen < minDHCPMsgSize { // Expand the packet to match the minimum DHCP message length. Although // the dhpcv4 package deals with the BOOTP's lower packet length // constraint, it seems some clients expecting the length being at least // 576 bytes as per RFC 2131 (and an obsolete RFC 1533). // // See https://github.com/AdguardTeam/AdGuardHome/issues/4337. pktData = append(pktData, make([]byte, minDHCPMsgSize-pktLen)...) } log.Debug("dhcpv4: sending %d bytes to %s: %s", len(pktData), peer, resp.Summary()) _, err := conn.WriteTo(pktData, peer) if err != nil { </s> remove func (c *dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) { </s> add func (*dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) { </s> remove dhcpLayer := gopacket.NewPacket(payload, layers.LayerTypeDHCPv4, gopacket.DecodeOptions{ NoCopy: true, }).Layer(layers.LayerTypeDHCPv4) // Check if the decoding succeeded and the resulting layer doesn't // contain any errors. It should guarantee panic-safe converting of the // layer into gopacket.SerializableLayer. if dhcpLayer == nil || dhcpLayer.LayerType() != layers.LayerTypeDHCPv4 { return nil, errInvalidPktDHCP } </s> add </s> remove // ipv4DefaultTTL is the default Time to Live value as recommended by // RFC-1700 (https://datatracker.ietf.org/doc/html/rfc1700) in seconds. </s> add // ipv4DefaultTTL is the default Time to Live value in seconds as recommended by // RFC-1700. // // See https://datatracker.ietf.org/doc/html/rfc1700. </s> remove // errInvalidPktDHCP is returned when the provided payload is not a valid DHCP // packet. const errInvalidPktDHCP errors.Error = "packet is not a valid dhcp packet" // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. The // payload is expected to be an encoded DHCP packet. </s> add // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. // Validation of the payload is a caller's responsibility.
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/v4.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> default: <mask> // Go on since peer is already set to broadcast. <mask> } <mask> <mask> log.Debug("dhcpv4: sending to %s: %s", peer, resp.Summary()) <mask> if _, err := conn.WriteTo(resp.ToBytes(), peer); err != nil { <mask> log.Error("dhcpv4: conn.Write to %s failed: %s", peer, err) <mask> } <mask> } <mask> <mask> // Start starts the IPv4 DHCP server. </s> Pull request: 4337 increase msg size Merge in DNS/adguard-home from 4337-dhcp-msg-len to master Updates #4337. Squashed commit of the following: commit 55e53c1fadd4ccb2a8b94117afff82e9a5d2734b Merge: f37070ea da1ae338 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 14:14:21 2022 +0300 Merge branch 'master' into 4337-dhcp-msg-len commit f37070ea0f3a7ff8efcbbafd36001f78d9b082b5 Author: Eugene Burkov <[email protected]> Date: Wed Sep 7 13:15:25 2022 +0300 dhcpd: imp ether pkt building commit fa43a0bcc24d4ca5e9193899dbba8495f3de5df9 Author: Eugene Burkov <[email protected]> Date: Tue Sep 6 18:55:07 2022 +0300 dhcpd: incr msg size </s> remove dhcpLayer := gopacket.NewPacket(payload, layers.LayerTypeDHCPv4, gopacket.DecodeOptions{ NoCopy: true, }).Layer(layers.LayerTypeDHCPv4) // Check if the decoding succeeded and the resulting layer doesn't // contain any errors. It should guarantee panic-safe converting of the // layer into gopacket.SerializableLayer. if dhcpLayer == nil || dhcpLayer.LayerType() != layers.LayerTypeDHCPv4 { return nil, errInvalidPktDHCP } </s> add </s> remove return 0, fmt.Errorf("peer is of unexpected type %T", addr) </s> add return 0, fmt.Errorf("addr has an unexpected type %T", addr) </s> add // minDHCPMsgSize is the minimum length of the encoded DHCP message in bytes // according to RFC-2131. // // See https://datatracker.ietf.org/doc/html/rfc2131#section-2. const minDHCPMsgSize = 576 </s> remove }, ethLayer, ipv4Layer, udpLayer, dhcpLayer.(gopacket.SerializableLayer)) </s> add } err = gopacket.SerializeLayers( buf, setts, ethLayer, ipv4Layer, udpLayer, gopacket.Payload(payload), ) </s> remove err = gopacket.SerializeLayers(buf, gopacket.SerializeOptions{ </s> add setts := gopacket.SerializeOptions{ </s> remove // errInvalidPktDHCP is returned when the provided payload is not a valid DHCP // packet. const errInvalidPktDHCP errors.Error = "packet is not a valid dhcp packet" // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. The // payload is expected to be an encoded DHCP packet. </s> add // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. // Validation of the payload is a caller's responsibility.
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/v4.go
keep keep keep keep replace keep keep keep keep keep
<mask> config.Users = nil <mask> <mask> Context.tls, err = newTLSManager(config.TLS) <mask> if err != nil { <mask> log.Fatalf("initializing tls: %s", err) <mask> } <mask> <mask> Context.web, err = initWeb(opts, clientBuildFS) <mask> fatalOnError(err) <mask> </s> Pull request: 5189-run-bad-cert Merge in DNS/adguard-home from 5189-run-bad-cert to master Closes #5189. Squashed commit of the following: commit 9e6ac6218163c7408200ce5fd591e8e6f5181f00 Author: Eugene Burkov <[email protected]> Date: Thu Nov 24 19:17:43 2022 +0300 all: imp chlog again commit 5870aee8efc3213feffbe1e61b2f5b411a69ece7 Author: Eugene Burkov <[email protected]> Date: Thu Nov 24 18:57:54 2022 +0300 all: imp chlog commit ec0d4b6ead14a6a6698d4a27819e679b2d4c7a0b Author: Eugene Burkov <[email protected]> Date: Thu Nov 24 18:43:04 2022 +0300 home: rm fatal on tls init errors </s> remove return nil, err </s> add m.conf.Enabled = false return m, err </s> remove // newTLSManager initializes the TLS configuration. </s> add // newTLSManager initializes the manager of TLS configuration. m is always // non-nil while any returned error indicates that the TLS configuration isn't // valid. Thus TLS may be initialized later, e.g. via the web UI.
https://github.com/AdguardTeam/AdGuardHome/commit/53a366ed463cf8cea1dec0e9619376cdb778ac52
internal/home/home.go
keep keep keep keep replace keep keep keep keep keep
<mask> confLock sync.Mutex <mask> conf tlsConfigSettings <mask> } <mask> <mask> // newTLSManager initializes the TLS configuration. <mask> func newTLSManager(conf tlsConfigSettings) (m *tlsManager, err error) { <mask> m = &tlsManager{ <mask> status: &tlsConfigStatus{}, <mask> conf: conf, <mask> } </s> Pull request: 5189-run-bad-cert Merge in DNS/adguard-home from 5189-run-bad-cert to master Closes #5189. Squashed commit of the following: commit 9e6ac6218163c7408200ce5fd591e8e6f5181f00 Author: Eugene Burkov <[email protected]> Date: Thu Nov 24 19:17:43 2022 +0300 all: imp chlog again commit 5870aee8efc3213feffbe1e61b2f5b411a69ece7 Author: Eugene Burkov <[email protected]> Date: Thu Nov 24 18:57:54 2022 +0300 all: imp chlog commit ec0d4b6ead14a6a6698d4a27819e679b2d4c7a0b Author: Eugene Burkov <[email protected]> Date: Thu Nov 24 18:43:04 2022 +0300 home: rm fatal on tls init errors </s> remove return nil, err </s> add m.conf.Enabled = false return m, err </s> remove log.Fatalf("initializing tls: %s", err) </s> add log.Error("initializing tls: %s", err) onConfigModified()
https://github.com/AdguardTeam/AdGuardHome/commit/53a366ed463cf8cea1dec0e9619376cdb778ac52
internal/home/tls.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> if m.conf.Enabled { <mask> err = m.load() <mask> if err != nil { <mask> return nil, err <mask> } <mask> <mask> m.setCertFileTime() <mask> } <mask> </s> Pull request: 5189-run-bad-cert Merge in DNS/adguard-home from 5189-run-bad-cert to master Closes #5189. Squashed commit of the following: commit 9e6ac6218163c7408200ce5fd591e8e6f5181f00 Author: Eugene Burkov <[email protected]> Date: Thu Nov 24 19:17:43 2022 +0300 all: imp chlog again commit 5870aee8efc3213feffbe1e61b2f5b411a69ece7 Author: Eugene Burkov <[email protected]> Date: Thu Nov 24 18:57:54 2022 +0300 all: imp chlog commit ec0d4b6ead14a6a6698d4a27819e679b2d4c7a0b Author: Eugene Burkov <[email protected]> Date: Thu Nov 24 18:43:04 2022 +0300 home: rm fatal on tls init errors </s> remove log.Fatalf("initializing tls: %s", err) </s> add log.Error("initializing tls: %s", err) onConfigModified() </s> remove // newTLSManager initializes the TLS configuration. </s> add // newTLSManager initializes the manager of TLS configuration. m is always // non-nil while any returned error indicates that the TLS configuration isn't // valid. Thus TLS may be initialized later, e.g. via the web UI.
https://github.com/AdguardTeam/AdGuardHome/commit/53a366ed463cf8cea1dec0e9619376cdb778ac52
internal/home/tls.go
keep keep keep keep replace keep keep keep keep keep
<mask> "strings" <mask> "sync" <mask> "time" <mask> <mask> "github.com/bluele/gcache" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> type hourTop struct { </s> Fix #597 - [bugfix] querylog_top: Empty domain gets to the Top Queried domains </s> add "github.com/bluele/gcache" </s> add // if question hostname is empty, do nothing if hostname == "" { return nil }
https://github.com/AdguardTeam/AdGuardHome/commit/53d680a5dfb027831bdbfc91bde5272d4d849a1a
dnsforward/querylog_top.go
keep keep add keep keep keep keep keep keep
<mask> "time" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> type hourTop struct { <mask> domains gcache.Cache <mask> blocked gcache.Cache </s> Fix #597 - [bugfix] querylog_top: Empty domain gets to the Top Queried domains </s> remove "github.com/bluele/gcache" </s> add </s> add // if question hostname is empty, do nothing if hostname == "" { return nil }
https://github.com/AdguardTeam/AdGuardHome/commit/53d680a5dfb027831bdbfc91bde5272d4d849a1a
dnsforward/querylog_top.go
keep keep keep add keep keep keep keep
<mask> } <mask> <mask> hostname := strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")) <mask> <mask> // get value, if not set, crate one <mask> d.hoursReadLock() <mask> defer d.hoursReadUnlock() <mask> err := d.hours[hour].incrementDomains(hostname) </s> Fix #597 - [bugfix] querylog_top: Empty domain gets to the Top Queried domains </s> add "github.com/bluele/gcache" </s> remove "github.com/bluele/gcache" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/53d680a5dfb027831bdbfc91bde5272d4d849a1a
dnsforward/querylog_top.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> func (s *Server) handleDHCP4Request(p dhcp4.Packet, options dhcp4.Options) dhcp4.Packet { <mask> var lease *Lease <mask> var err error <mask> <mask> reqIP := net.IP(options[dhcp4.OptionRequestedIPAddress]) <mask> log.Tracef("Message from client: Request. IP: %s ReqIP: %s HW: %s", <mask> p.CIAddr(), reqIP, p.CHAddr()) <mask> </s> * dhcp: don't allocate a new lease when processing Request message </s> remove lease, err = s.reserveLease(p) if err != nil { log.Tracef("Couldn't find free lease: %s", err) // couldn't find lease, don't respond return nil } </s> add log.Tracef("Lease for %s isn't found", p.CHAddr()) return dhcp4.ReplyPacket(p, dhcp4.NAK, s.ipnet.IP, nil, 0, nil) </s> remove check(t, bytes.Equal(opt[dhcp4.OptionDHCPMessageType], []byte{byte(dhcp4.ACK)}), "dhcp4.ACK") check(t, bytes.Equal(p2.YIAddr(), []byte{1, 1, 1, 1}), "p2.YIAddr") check(t, bytes.Equal(p2.CHAddr(), hw), "p2.CHAddr") check(t, bytes.Equal(opt[dhcp4.OptionIPAddressLeaseTime], dhcp4.OptionsLeaseTime(5*time.Second)), "OptionIPAddressLeaseTime") check(t, bytes.Equal(opt[dhcp4.OptionServerIdentifier], s.ipnet.IP), "OptionServerIdentifier") </s> add check(t, bytes.Equal(opt[dhcp4.OptionDHCPMessageType], []byte{byte(dhcp4.NAK)}), "dhcp4.NAK") </s> remove // Commit a lease for an IP without prior Discover-Offer packets </s> add // Try to commit a lease for an IP without prior Discover-Offer packets </s> remove // Try to reserve another IP for the same machine - no new IP must be reserved hw = []byte{1, 2, 3, 4, 5, 6} p.SetCHAddr(hw) lease, _ = s.reserveLease(p) </s> add lease = s.findLease(p)
https://github.com/AdguardTeam/AdGuardHome/commit/542a67b84edc067d864164fbb9f566447a97ccb8
dhcpd/dhcpd.go
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
<mask> } <mask> <mask> lease = s.findLease(p) <mask> if lease == nil { <mask> lease, err = s.reserveLease(p) <mask> if err != nil { <mask> log.Tracef("Couldn't find free lease: %s", err) <mask> // couldn't find lease, don't respond <mask> return nil <mask> } <mask> } <mask> <mask> if !lease.IP.Equal(reqIP) { <mask> log.Tracef("Lease for %s doesn't match requested/client IP: %s vs %s", <mask> lease.HWAddr, lease.IP, reqIP) </s> * dhcp: don't allocate a new lease when processing Request message </s> remove var err error </s> add </s> remove // Try to reserve another IP for the same machine - no new IP must be reserved hw = []byte{1, 2, 3, 4, 5, 6} p.SetCHAddr(hw) lease, _ = s.reserveLease(p) </s> add lease = s.findLease(p) </s> remove check(t, bytes.Equal(opt[dhcp4.OptionDHCPMessageType], []byte{byte(dhcp4.ACK)}), "dhcp4.ACK") check(t, bytes.Equal(p2.YIAddr(), []byte{1, 1, 1, 1}), "p2.YIAddr") check(t, bytes.Equal(p2.CHAddr(), hw), "p2.CHAddr") check(t, bytes.Equal(opt[dhcp4.OptionIPAddressLeaseTime], dhcp4.OptionsLeaseTime(5*time.Second)), "OptionIPAddressLeaseTime") check(t, bytes.Equal(opt[dhcp4.OptionServerIdentifier], s.ipnet.IP), "OptionServerIdentifier") </s> add check(t, bytes.Equal(opt[dhcp4.OptionDHCPMessageType], []byte{byte(dhcp4.NAK)}), "dhcp4.NAK") </s> remove // Commit a lease for an IP without prior Discover-Offer packets </s> add // Try to commit a lease for an IP without prior Discover-Offer packets
https://github.com/AdguardTeam/AdGuardHome/commit/542a67b84edc067d864164fbb9f566447a97ccb8
dhcpd/dhcpd.go
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> p.SetCHAddr(hw) <mask> lease, _ = s.reserveLease(p) <mask> check(t, bytes.Equal(lease.HWAddr, hw), "lease.HWAddr") <mask> check(t, bytes.Equal(lease.IP, []byte{1, 1, 1, 1}), "lease.IP") <mask> <mask> // Try to reserve another IP for the same machine - no new IP must be reserved <mask> hw = []byte{1, 2, 3, 4, 5, 6} <mask> p.SetCHAddr(hw) <mask> lease, _ = s.reserveLease(p) <mask> check(t, bytes.Equal(lease.HWAddr, hw), "lease.HWAddr") <mask> check(t, bytes.Equal(lease.IP, []byte{1, 1, 1, 1}), "lease.IP") <mask> <mask> // Reserve an IP - the next IP from the range <mask> hw = []byte{2, 2, 3, 4, 5, 6} </s> * dhcp: don't allocate a new lease when processing Request message </s> remove // Commit a lease for an IP without prior Discover-Offer packets </s> add // Try to commit a lease for an IP without prior Discover-Offer packets </s> remove check(t, bytes.Equal(opt[dhcp4.OptionDHCPMessageType], []byte{byte(dhcp4.ACK)}), "dhcp4.ACK") check(t, bytes.Equal(p2.YIAddr(), []byte{1, 1, 1, 1}), "p2.YIAddr") check(t, bytes.Equal(p2.CHAddr(), hw), "p2.CHAddr") check(t, bytes.Equal(opt[dhcp4.OptionIPAddressLeaseTime], dhcp4.OptionsLeaseTime(5*time.Second)), "OptionIPAddressLeaseTime") check(t, bytes.Equal(opt[dhcp4.OptionServerIdentifier], s.ipnet.IP), "OptionServerIdentifier") </s> add check(t, bytes.Equal(opt[dhcp4.OptionDHCPMessageType], []byte{byte(dhcp4.NAK)}), "dhcp4.NAK") </s> remove lease, err = s.reserveLease(p) if err != nil { log.Tracef("Couldn't find free lease: %s", err) // couldn't find lease, don't respond return nil } </s> add log.Tracef("Lease for %s isn't found", p.CHAddr()) return dhcp4.ReplyPacket(p, dhcp4.NAK, s.ipnet.IP, nil, 0, nil) </s> remove var err error </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/542a67b84edc067d864164fbb9f566447a97ccb8
dhcpd/dhcpd_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> var opt dhcp4.Options <mask> <mask> p = make(dhcp4.Packet, 241) <mask> <mask> // Commit a lease for an IP without prior Discover-Offer packets <mask> hw = []byte{2, 2, 3, 4, 5, 6} <mask> p.SetCHAddr(hw) <mask> p.SetCIAddr([]byte{0, 0, 0, 0}) <mask> opt = make(dhcp4.Options, 10) <mask> opt[dhcp4.OptionRequestedIPAddress] = []byte{1, 1, 1, 1} </s> * dhcp: don't allocate a new lease when processing Request message </s> remove // Try to reserve another IP for the same machine - no new IP must be reserved hw = []byte{1, 2, 3, 4, 5, 6} p.SetCHAddr(hw) lease, _ = s.reserveLease(p) </s> add lease = s.findLease(p) </s> remove check(t, bytes.Equal(opt[dhcp4.OptionDHCPMessageType], []byte{byte(dhcp4.ACK)}), "dhcp4.ACK") check(t, bytes.Equal(p2.YIAddr(), []byte{1, 1, 1, 1}), "p2.YIAddr") check(t, bytes.Equal(p2.CHAddr(), hw), "p2.CHAddr") check(t, bytes.Equal(opt[dhcp4.OptionIPAddressLeaseTime], dhcp4.OptionsLeaseTime(5*time.Second)), "OptionIPAddressLeaseTime") check(t, bytes.Equal(opt[dhcp4.OptionServerIdentifier], s.ipnet.IP), "OptionServerIdentifier") </s> add check(t, bytes.Equal(opt[dhcp4.OptionDHCPMessageType], []byte{byte(dhcp4.NAK)}), "dhcp4.NAK") </s> remove lease, err = s.reserveLease(p) if err != nil { log.Tracef("Couldn't find free lease: %s", err) // couldn't find lease, don't respond return nil } </s> add log.Tracef("Lease for %s isn't found", p.CHAddr()) return dhcp4.ReplyPacket(p, dhcp4.NAK, s.ipnet.IP, nil, 0, nil) </s> remove var err error </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/542a67b84edc067d864164fbb9f566447a97ccb8
dhcpd/dhcpd_test.go
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> opt = make(dhcp4.Options, 10) <mask> opt[dhcp4.OptionRequestedIPAddress] = []byte{1, 1, 1, 1} <mask> p2 = s.handleDHCP4Request(p, opt) <mask> opt = p2.ParseOptions() <mask> check(t, bytes.Equal(opt[dhcp4.OptionDHCPMessageType], []byte{byte(dhcp4.ACK)}), "dhcp4.ACK") <mask> check(t, bytes.Equal(p2.YIAddr(), []byte{1, 1, 1, 1}), "p2.YIAddr") <mask> check(t, bytes.Equal(p2.CHAddr(), hw), "p2.CHAddr") <mask> check(t, bytes.Equal(opt[dhcp4.OptionIPAddressLeaseTime], dhcp4.OptionsLeaseTime(5*time.Second)), "OptionIPAddressLeaseTime") <mask> check(t, bytes.Equal(opt[dhcp4.OptionServerIdentifier], s.ipnet.IP), "OptionServerIdentifier") <mask> } <mask> <mask> // Leases database store/load <mask> func TestDB(t *testing.T) { <mask> var s = Server{} </s> * dhcp: don't allocate a new lease when processing Request message </s> remove // Try to reserve another IP for the same machine - no new IP must be reserved hw = []byte{1, 2, 3, 4, 5, 6} p.SetCHAddr(hw) lease, _ = s.reserveLease(p) </s> add lease = s.findLease(p) </s> remove // Commit a lease for an IP without prior Discover-Offer packets </s> add // Try to commit a lease for an IP without prior Discover-Offer packets </s> remove lease, err = s.reserveLease(p) if err != nil { log.Tracef("Couldn't find free lease: %s", err) // couldn't find lease, don't respond return nil } </s> add log.Tracef("Lease for %s isn't found", p.CHAddr()) return dhcp4.ReplyPacket(p, dhcp4.NAK, s.ipnet.IP, nil, 0, nil) </s> remove var err error </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/542a67b84edc067d864164fbb9f566447a97ccb8
dhcpd/dhcpd_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> }, <mask> "ansi-regex": { <mask> "version": "2.1.1", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "aproba": { <mask> "version": "1.2.0", <mask> "bundled": true, <mask> "dev": true, </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> add "optional": true, </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
keep keep keep keep replace keep keep keep keep keep
<mask> }, <mask> "balanced-match": { <mask> "version": "1.0.0", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "brace-expansion": { <mask> "version": "1.1.11", <mask> "bundled": true, <mask> "dev": true, </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> add "optional": true, </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
keep keep keep add keep keep keep keep keep keep
<mask> "brace-expansion": { <mask> "version": "1.1.11", <mask> "bundled": true, <mask> "dev": true, <mask> "requires": { <mask> "balanced-match": "^1.0.0", <mask> "concat-map": "0.0.1" <mask> } <mask> }, <mask> "chownr": { </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> remove "dev": true </s> add "dev": true, "optional": true </s> add "optional": true, </s> add "optional": true, </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> add "optional": true,
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
keep replace keep keep keep keep replace keep keep keep
<mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "concat-map": { <mask> "version": "0.0.1", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "console-control-strings": { <mask> "version": "1.1.0", </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
keep keep keep keep replace keep keep keep keep keep
<mask> }, <mask> "console-control-strings": { <mask> "version": "1.1.0", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "core-util-is": { <mask> "version": "1.0.2", <mask> "bundled": true, <mask> "dev": true, </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
keep keep keep keep replace keep keep keep keep keep
<mask> }, <mask> "inherits": { <mask> "version": "2.0.3", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "ini": { <mask> "version": "1.3.5", <mask> "bundled": true, <mask> "dev": true, </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
keep add keep keep keep keep
<mask> "bundled": true, <mask> "dev": true, <mask> "requires": { <mask> "number-is-nan": "^1.0.0" <mask> } <mask> }, </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> remove "dev": true </s> add "dev": true, "optional": true </s> add "optional": true, </s> add "optional": true, </s> add "optional": true, </s> add "optional": true, </s> add "optional": true,
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
keep add keep keep keep keep keep
<mask> "bundled": true, <mask> "dev": true, <mask> "requires": { <mask> "brace-expansion": "^1.1.7" <mask> } <mask> }, <mask> "minimist": { </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> add "optional": true, </s> add "optional": true, </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> add "optional": true, </s> add "optional": true,
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
keep keep keep keep replace keep keep keep keep keep
<mask> }, <mask> "minimist": { <mask> "version": "0.0.8", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "minipass": { <mask> "version": "2.2.4", <mask> "bundled": true, <mask> "dev": true, </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> add "optional": true, </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
keep keep add keep keep keep keep
<mask> "version": "2.2.4", <mask> "bundled": true, <mask> "dev": true, <mask> "requires": { <mask> "safe-buffer": "^5.1.1", <mask> "yallist": "^3.0.0" <mask> } </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> add "optional": true, </s> remove "dev": true </s> add "dev": true, "optional": true </s> remove "dev": true </s> add "dev": true, "optional": true </s> add "optional": true,
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json