docstring_tokens stringlengths 0 76.5k | code_tokens stringlengths 75 1.81M | label_window listlengths 4 2.12k | html_url stringlengths 74 116 | file_name stringlengths 3 311 |
|---|---|---|---|---|
srcIP: s.conf.dnsIPAddrs[0].AsSlice(), | <mask> udpConn: bcast,
<mask> bcastIP: s.conf.broadcastIP,
<mask> rawConn: ucast,
<mask> srcMAC: iface.HardwareAddr,
<mask> srcIP: s.conf.dnsIPAddrs[0],
<mask> }, nil
<mask> }
<mask>
<mask> // wrapErrs is a helper to wrap the errors from two independent underlying
<mask> // connections.
</s> P... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/conn_unix.go |
v4conf.Enabled = s.conf.Enabled && v4conf.RangeStart.IsValid() | <mask>
<mask> v4conf := conf.Conf4
<mask> v4conf.InterfaceName = s.conf.InterfaceName
<mask> v4conf.notify = s.onNotify
<mask> v4conf.Enabled = s.conf.Enabled && len(v4conf.RangeStart) != 0
<mask>
<mask> s.srv4, err = v4Create(&v4conf)
<mask> if err != nil {
<mask> if v4conf.Enabled {
<mask> retu... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/dhcpd.go |
"net/netip" | <mask> package dhcpd
<mask>
<mask> import (
<mask> "net"
<mask> "os"
<mask> "testing"
<mask> "time"
<mask>
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/dhcpd_unix_test.go |
RangeStart: netip.MustParseAddr("192.168.10.100"),
RangeEnd: netip.MustParseAddr("192.168.10.200"),
GatewayIP: netip.MustParseAddr("192.168.10.1"),
SubnetMask: netip.MustParseAddr("255.255.255.0"), | <mask> }
<mask>
<mask> s.srv4, err = v4Create(&V4ServerConf{
<mask> Enabled: true,
<mask> RangeStart: net.IP{192, 168, 10, 100},
<mask> RangeEnd: net.IP{192, 168, 10, 200},
<mask> GatewayIP: net.IP{192, 168, 10, 1},
<mask> SubnetMask: net.IP{255, 255, 255, 0},
<mask> notify: testNotify... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/dhcpd_unix_test.go |
gatewayIP netip.Addr
subnetMask netip.Addr | <mask> testCases := []struct {
<mask> name string
<mask> wantErrMsg string
<mask> }{{
<mask> name: "gateway_in_range",
<mask> gatewayIP: netip.MustParseAddr("192.168.10.120"),
<mask> subnetMask: netip.MustParseAddr("255.255.255.0"),
<mask> wantErrMsg: "dhcpv4: gateway ip 192.168.10.12... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/dhcpd_unix_test.go |
<mask> func TestV4Server_badRange(t *testing.T) {
<mask> testCases := []struct {
<mask> name string
<mask> wantErrMsg string
<mask> gatewayIP net.IP
<mask> subnetMask net.IP
<mask> }{{
<mask> name: "gateway_in_range",
<mask> wantErrMsg: "dhcpv4: gateway ip 192.168.10.120 in the ip range: "... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/dhcpd_unix_test.go | |
name: "gateway_in_range",
gatewayIP: netip.MustParseAddr("192.168.10.120"),
subnetMask: netip.MustParseAddr("255.255.255.0"), | <mask> wantErrMsg string
<mask> gatewayIP net.IP
<mask> subnetMask net.IP
<mask> }{{
<mask> name: "gateway_in_range",
<mask> wantErrMsg: "dhcpv4: gateway ip 192.168.10.120 in the ip range: " +
<mask> "192.168.10.20-192.168.10.200",
<mask> gatewayIP: net.IP{192, 168, 10, 120},
<mask> subnetM... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/dhcpd_unix_test.go |
<mask> }{{
<mask> name: "gateway_in_range",
<mask> wantErrMsg: "dhcpv4: gateway ip 192.168.10.120 in the ip range: " +
<mask> "192.168.10.20-192.168.10.200",
<mask> gatewayIP: net.IP{192, 168, 10, 120},
<mask> subnetMask: net.IP{255, 255, 255, 0},
<mask> }, {
<mask> name: "outside_range_start",
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/dhcpd_unix_test.go | |
name: "outside_range_start",
gatewayIP: netip.MustParseAddr("192.168.10.1"),
subnetMask: netip.MustParseAddr("255.255.255.240"), | <mask> "192.168.10.20-192.168.10.200",
<mask> gatewayIP: net.IP{192, 168, 10, 120},
<mask> subnetMask: net.IP{255, 255, 255, 0},
<mask> }, {
<mask> name: "outside_range_start",
<mask> wantErrMsg: "dhcpv4: range start 192.168.10.20 is outside network " +
<mask> "192.168.10.1/28",
<mask> gateway... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/dhcpd_unix_test.go |
<mask> }, {
<mask> name: "outside_range_start",
<mask> wantErrMsg: "dhcpv4: range start 192.168.10.20 is outside network " +
<mask> "192.168.10.1/28",
<mask> gatewayIP: net.IP{192, 168, 10, 1},
<mask> subnetMask: net.IP{255, 255, 255, 240},
<mask> }, {
<mask> name: "outside_range_end",
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/dhcpd_unix_test.go | |
name: "outside_range_end",
gatewayIP: netip.MustParseAddr("192.168.10.1"),
subnetMask: netip.MustParseAddr("255.255.255.224"), | <mask> "192.168.10.1/28",
<mask> gatewayIP: net.IP{192, 168, 10, 1},
<mask> subnetMask: net.IP{255, 255, 255, 240},
<mask> }, {
<mask> name: "outside_range_end",
<mask> wantErrMsg: "dhcpv4: range end 192.168.10.200 is outside network " +
<mask> "192.168.10.1/27",
<mask> gatewayIP: net.IP{192,... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/dhcpd_unix_test.go |
<mask> }, {
<mask> name: "outside_range_end",
<mask> wantErrMsg: "dhcpv4: range end 192.168.10.200 is outside network " +
<mask> "192.168.10.1/27",
<mask> gatewayIP: net.IP{192, 168, 10, 1},
<mask> subnetMask: net.IP{255, 255, 255, 224},
<mask> }}
<mask>
<mask> for _, tc := range testCases {
<... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/dhcpd_unix_test.go | |
RangeStart: netip.MustParseAddr("192.168.10.20"),
RangeEnd: netip.MustParseAddr("192.168.10.200"), | <mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
<mask> conf := V4ServerConf{
<mask> Enabled: true,
<mask> RangeStart: net.IP{192, 168, 10, 20},
<mask> RangeEnd: net.IP{192, 168, 10, 200},
<mask> GatewayIP: tc.gatewayIP,
<mask> SubnetMask: tc.subne... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/dhcpd_unix_test.go |
"net/netip" | <mask> "net"
<mask> "net/http"
<mask> "os"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghalg"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/golibs/errors"
</s> Pull request: Migrate... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/http_unix.go |
GatewayIP netip.Addr `json:"gateway_ip"`
SubnetMask netip.Addr `json:"subnet_mask"`
RangeStart netip.Addr `json:"range_start"`
RangeEnd netip.Addr `json:"range_end"`
LeaseDuration uint32 `json:"lease_duration"` | <mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
<mask> type v4ServerConfJSON struct {
<mask> GatewayIP net.IP `json:"gateway_ip"`
<mask> SubnetMask net.IP `json:"subnet_mask"`
<mask> RangeStart net.IP `json:"range_start"`
<mask> RangeEnd net.IP `json:"range_end"`
<mask> LeaseDu... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/http_unix.go |
RangeStart netip.Addr `json:"range_start"`
LeaseDuration uint32 `json:"lease_duration"` | <mask> }
<mask> }
<mask>
<mask> type v6ServerConfJSON struct {
<mask> RangeStart net.IP `json:"range_start"`
<mask> LeaseDuration uint32 `json:"lease_duration"`
<mask> }
<mask>
<mask> func v6JSONToServerConf(j *v6ServerConfJSON) V6ServerConf {
<mask> if j == nil {
<mask> return V6ServerConf{}
</s... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/http_unix.go |
RangeStart: j.RangeStart.AsSlice(), | <mask> return V6ServerConf{}
<mask> }
<mask>
<mask> return V6ServerConf{
<mask> RangeStart: j.RangeStart,
<mask> LeaseDuration: j.LeaseDuration,
<mask> }
<mask> }
<mask>
<mask> // dhcpStatusResponse is the response for /control/dhcp/status endpoint.
</s> Pull request: Migrate to netip.Addr vol.... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/http_unix.go |
if !v4Conf.RangeStart.IsValid() { | <mask> }
<mask>
<mask> v4Conf := conf.V4.toServerConf()
<mask> v4Conf.Enabled = conf.Enabled == aghalg.NBTrue
<mask> if len(v4Conf.RangeStart) == 0 {
<mask> v4Conf.Enabled = false
<mask> }
<mask>
<mask> v4Conf.InterfaceName = conf.InterfaceName
<mask>
</s> Pull request: Migrate to netip.Addr vol.1... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/http_unix.go |
Name string `json:"name"`
HardwareAddr string `json:"hardware_address"`
Flags string `json:"flags"`
GatewayIP netip.Addr `json:"gateway_ip"`
Addrs4 []netip.Addr `json:"ipv4_addresses"`
Addrs6 []netip.Addr `json:"ipv6_addresses"` | <mask> }
<mask> }
<mask>
<mask> type netInterfaceJSON struct {
<mask> Name string `json:"name"`
<mask> HardwareAddr string `json:"hardware_address"`
<mask> Flags string `json:"flags"`
<mask> GatewayIP net.IP `json:"gateway_ip"`
<mask> Addrs4 []net.IP `json:"ipv4_addresses... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/http_unix.go |
//
// TODO(e.burkov): Try to listen DHCP on LLA as well. | <mask>
<mask> return
<mask> }
<mask> // ignore link-local
<mask> if ipnet.IP.IsLinkLocalUnicast() {
<mask> continue
<mask> }
<mask>
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the f... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/http_unix.go |
if ip4 := ipnet.IP.To4(); ip4 != nil {
addr := netip.AddrFrom4(*(*[4]byte)(ip4))
jsonIface.Addrs4 = append(jsonIface.Addrs4, addr) | <mask> // ignore link-local
<mask> if ipnet.IP.IsLinkLocalUnicast() {
<mask> continue
<mask> }
<mask> if ipnet.IP.To4() != nil {
<mask> jsonIface.Addrs4 = append(jsonIface.Addrs4, ipnet.IP)
<mask> } else {
<mask> jsonIface.Addrs6 = append(jsonIface.Addrs6, ipnet.IP)
<mask> }
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/http_unix.go |
addr := netip.AddrFrom16(*(*[16]byte)(ipnet.IP))
jsonIface.Addrs6 = append(jsonIface.Addrs6, addr) | <mask> }
<mask> if ipnet.IP.To4() != nil {
<mask> jsonIface.Addrs4 = append(jsonIface.Addrs4, ipnet.IP)
<mask> } else {
<mask> jsonIface.Addrs6 = append(jsonIface.Addrs6, ipnet.IP)
<mask> }
<mask> }
<mask> if len(jsonIface.Addrs4)+len(jsonIface.Addrs6) != 0 {
<mask> jsonIface.Gateway... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/http_unix.go |
//
// TODO(e.burkov): Use netip.Addr. | <mask>
<mask> // newIPRange creates a new IP address range. start must be less than end. The
<mask> // resulting range must not be greater than maxRangeLen.
<mask> func newIPRange(start, end net.IP) (r *ipRange, err error) {
<mask> defer func() { err = errors.Annotate(err, "invalid ip range: %w") }()
<mask>
... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/iprange.go |
dhcpv4.OptRouter(s.conf.GatewayIP.AsSlice()), | <mask> // See https://datatracker.ietf.org/doc/html/rfc1122#section-4.2.3.6.
<mask> dhcpv4.OptGeneric(dhcpv4.OptionTCPKeepaliveGarbage, []byte{0x01}),
<mask>
<mask> // Values From Configuration
<mask>
<mask> dhcpv4.OptSubnetMask(s.conf.SubnetMask.AsSlice()),
<mask> )
<mask>
<mask> // Set values fo... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/options_unix.go |
dhcpv4.OptSubnetMask(s.conf.SubnetMask.AsSlice()), | <mask> dhcpv4.OptGeneric(dhcpv4.OptionTCPKeepaliveGarbage, []byte{0x01}),
<mask>
<mask> // Values From Configuration
<mask>
<mask> // Set the Router Option to working subnet's IP since it's initialized
<mask> // with the address of the gateway.
<mask> dhcpv4.OptRouter(s.conf.subnet.IP),
<mask>
<ma... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/options_unix.go |
<mask>
<mask> for _, tc := range testCases {
<mask> s := &v4Server{
<mask> conf: &V4ServerConf{
<mask> // Just to avoid nil pointer dereference.
<mask> subnet: &net.IPNet{},
<mask> Options: tc.opts,
<mask> },
<mask> }
<mask>
<mask> t.Run(tc.name, func(t *testing.T) {
</s> Pull re... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/options_unix_test.go | |
"net/netip" | <mask> "fmt"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/golibs/errors"
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Up... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix.go |
addr := netip.AddrFrom4(*(*[4]byte)(l.IP.To4()))
if sn := s.conf.subnet; !sn.Contains(addr) { | <mask>
<mask> if l.IsStatic() {
<mask> // TODO(a.garipov, d.seregin): Subnet can be nil when dhcp server is
<mask> // disabled.
<mask> if sn := s.conf.subnet; !sn.Contains(l.IP) {
<mask> return fmt.Errorf("subnet %s does not contain the ip %q", sn, l.IP)
<mask> }
<mask> } else if !inOffset {
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix.go |
} else if gwIP := s.conf.GatewayIP; gwIP == netip.AddrFrom4(*(*[4]byte)(ip)) { | <mask>
<mask> ip := l.IP.To4()
<mask> if ip == nil {
<mask> return fmt.Errorf("invalid ip %q, only ipv4 is supported", l.IP)
<mask> } else if gwIP := s.conf.GatewayIP; gwIP.Equal(ip) {
<mask> return fmt.Errorf("can't assign the gateway IP %s to the lease", gwIP)
<mask> }
<mask>
<mask> l.Expiry = tim... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix.go |
if !sid.Equal(s.conf.dnsIPAddrs[0].AsSlice()) { | <mask> ) (l *Lease, needsReply bool) {
<mask> // Client inserts the address of the selected server in server identifier,
<mask> // ciaddr MUST be zero.
<mask> mac := req.ClientHWAddr
<mask> if !sid.Equal(s.conf.dnsIPAddrs[0]) {
<mask> log.Debug("dhcpv4: bad server identifier in req msg for %s: %s", mac, sid... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix.go |
ip4 := reqIP.To4()
if ip4 == nil { | <mask> // handleInitReboot handles the DHCPREQUEST generated during INIT-REBOOT state.
<mask> func (s *v4Server) handleInitReboot(req *dhcpv4.DHCPv4, reqIP net.IP) (l *Lease, needsReply bool) {
<mask> mac := req.ClientHWAddr
<mask>
<mask> if ip4 := reqIP.To4(); ip4 == nil {
<mask> log.Debug("dhcpv4: bad requ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix.go |
if !s.conf.subnet.Contains(netip.AddrFrom4(*(*[4]byte)(ip4))) { | <mask>
<mask> return nil, false
<mask> }
<mask>
<mask> if !s.conf.subnet.Contains(reqIP) {
<mask> // If the DHCP server detects that the client is on the wrong net then
<mask> // the server SHOULD send a DHCPNAK message to the client.
<mask> log.Debug("dhcpv4: wrong subnet in init-reboot req msg for... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix.go |
resp.UpdateOption(dhcpv4.OptServerIdentifier(s.conf.dnsIPAddrs[0].AsSlice())) | <mask>
<mask> // Include server's identifier option since any reply should contain it.
<mask> //
<mask> // See https://datatracker.ietf.org/doc/html/rfc2131#page-29.
<mask> resp.UpdateOption(dhcpv4.OptServerIdentifier(s.conf.dnsIPAddrs[0]))
<mask>
<mask> // TODO(a.garipov): Refactor this into handlers.
<... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix.go |
for _, ip := range dnsIPAddrs {
ip = ip.To4()
if ip == nil {
continue
}
s.conf.dnsIPAddrs = append(s.conf.dnsIPAddrs, netip.AddrFrom4(*(*[4]byte)(ip)))
} | <mask> if !s.explicitOpts.Has(dhcpv4.OptionDomainNameServer) {
<mask> s.implicitOpts.Update(dhcpv4.OptDNS(dnsIPAddrs...))
<mask> }
<mask>
<mask> s.conf.dnsIPAddrs = dnsIPAddrs
<mask>
<mask> var c net.PacketConn
<mask> if c, err = s.newDHCPConn(iface); err != nil {
<mask> return err
<mask> }
</s> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix.go |
"net/netip" | <mask> "fmt"
<mask> "net"
<mask> "strings"
<mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the followin... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
DefaultRangeStart = netip.MustParseAddr("192.168.10.100")
DefaultRangeEnd = netip.MustParseAddr("192.168.10.200")
DefaultGatewayIP = netip.MustParseAddr("192.168.10.1")
DefaultSelfIP = netip.MustParseAddr("192.168.10.2")
DefaultSubnetMask = netip.MustParseAddr("255.255.255.0") | <mask> "github.com/mdlayher/raw"
<mask> )
<mask>
<mask> var (
<mask> DefaultRangeStart = net.IP{192, 168, 10, 100}
<mask> DefaultRangeEnd = net.IP{192, 168, 10, 200}
<mask> DefaultGatewayIP = net.IP{192, 168, 10, 1}
<mask> DefaultSelfIP = net.IP{192, 168, 10, 2}
<mask> DefaultSubnetMask = net.IP{... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
dnsIPAddrs: []netip.Addr{DefaultSelfIP}, | <mask> RangeEnd: DefaultRangeEnd,
<mask> GatewayIP: DefaultGatewayIP,
<mask> SubnetMask: DefaultSubnetMask,
<mask> notify: testNotify,
<mask> dnsIPAddrs: []net.IP{DefaultSelfIP},
<mask> }
<mask> }
<mask>
<mask> // defaultSrv prepares the default DHCPServer to use in tests. The underlying
<... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
IP: anotherIP.AsSlice(), | <mask> err = s.AddStaticLease(&Lease{
<mask> Expiry: time.Unix(leaseExpireStatic, 0),
<mask> Hostname: staticName,
<mask> HWAddr: anotherMAC,
<mask> IP: anotherIP,
<mask> })
<mask> assert.ErrorIs(t, err, ErrDupHostname)
<mask> })
<mask>
<mask> t.Run("same_mac", func(t *... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
IP: anotherIP.AsSlice(), | <mask> err = s.AddStaticLease(&Lease{
<mask> Expiry: time.Unix(leaseExpireStatic, 0),
<mask> Hostname: anotherName,
<mask> HWAddr: staticMAC,
<mask> IP: anotherIP,
<mask> })
<mask> testutil.AssertErrorMsg(t, wantErrMsg, err)
<mask> })
<mask>
<mask> t.Run("same_ip", func... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
dhcpv4.WithGatewayIP(DefaultGatewayIP.AsSlice()), | <mask> mac,
<mask> dhcpv4.WithOption(dhcpv4.OptHostName(name)),
<mask> dhcpv4.WithOption(dhcpv4.OptRequestedIPAddress(ip)),
<mask> dhcpv4.WithOption(dhcpv4.OptClientIdentifier([]byte{1, 2, 3, 4, 5, 6, 8})),
<mask> dhcpv4.WithGatewayIP(DefaultGatewayIP),
<mask> )
<mask> require.NoError(t... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
resp := discoverAnOffer(t, staticName, anotherIP.AsSlice(), anotherMAC) | <mask> return resp
<mask> }
<mask>
<mask> t.Run("same_name", func(t *testing.T) {
<mask> resp := discoverAnOffer(t, staticName, anotherIP, anotherMAC)
<mask>
<mask> req, err := dhcpv4.NewRequestFromOffer(resp, dhcpv4.WithOption(
<mask> dhcpv4.OptHostName(staticName),
<mask> ))
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
resp := discoverAnOffer(t, anotherName, anotherIP.AsSlice(), staticMAC) | <mask> assert.Equal(t, aghnet.GenerateHostname(resp.YourIPAddr), resp.HostName())
<mask> })
<mask>
<mask> t.Run("same_mac", func(t *testing.T) {
<mask> resp := discoverAnOffer(t, anotherName, anotherIP, staticMAC)
<mask>
<mask> req, err := dhcpv4.NewRequestFromOffer(resp, dhcpv4.WithOption(
<mask... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
IP: DefaultGatewayIP.AsSlice(), | <mask> }, {
<mask> lease: &Lease{
<mask> Hostname: "probably-router.local",
<mask> HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA},
<mask> IP: DefaultGatewayIP,
<mask> },
<mask> name: "with_gateway_ip",
<mask> wantErrMsg: "dhcpv4: adding static lease: " +
<mask> "can't... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
defaultIP := netip.MustParseAddr("192.168.1.1") | <mask> }
<mask> }
<mask>
<mask> func TestV4Server_handle_optionsPriority(t *testing.T) {
<mask> defaultIP := net.IP{192, 168, 1, 1}
<mask> knownIP := net.IP{1, 2, 3, 4}
<mask>
<mask> // prepareSrv creates a *v4Server and sets the opt6IPs in the initial
<mask> // configuration of the server as the value ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
defer func() { s.implicitOpts.Update(dhcpv4.OptDNS(defaultIP.AsSlice())) }() | <mask> stringutil.WriteToBuilder(b, ",", ip.String())
<mask> }
<mask> conf.Options = []string{b.String()}
<mask> } else {
<mask> defer func() { s.implicitOpts.Update(dhcpv4.OptDNS(defaultIP)) }()
<mask> }
<mask>
<mask> var err error
<mask> s, err = v4Create(conf)
<mask> require.NoError... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
s.conf.dnsIPAddrs = []netip.Addr{defaultIP} | <mask> var err error
<mask> s, err = v4Create(conf)
<mask> require.NoError(t, err)
<mask>
<mask> s.conf.dnsIPAddrs = []net.IP{defaultIP}
<mask>
<mask> return s
<mask> }
<mask>
<mask> // checkResp creates a discovery message with DHCP option 6 requested amd
</s> Pull request: Migrate to netip.A... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
checkResp(t, s, []net.IP{defaultIP.AsSlice()}) | <mask>
<mask> t.Run("default", func(t *testing.T) {
<mask> s := prepareSrv(t, nil)
<mask>
<mask> checkResp(t, s, []net.IP{defaultIP})
<mask> })
<mask>
<mask> t.Run("explicitly_configured", func(t *testing.T) {
<mask> s := prepareSrv(t, []net.IP{knownIP, knownIP})
<mask>
</s> Pull request: Migrat... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
dnsAddr := netip.MustParseAddr("192.168.10.1")
s.conf.dnsIPAddrs = []netip.Addr{dnsAddr}
s.implicitOpts.Update(dhcpv4.OptDNS(dnsAddr.AsSlice())) | <mask>
<mask> s, ok := sIface.(*v4Server)
<mask> require.True(t, ok)
<mask>
<mask> s.conf.dnsIPAddrs = []net.IP{{192, 168, 10, 1}}
<mask> s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs...))
<mask>
<mask> l := &Lease{
<mask> Hostname: "static-1.local",
<mask> HWAddr: net.HardwareAddr{0xAA,... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice()))
assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice()))
ones, _ := resp.SubnetMask().Size()
assert.Equal(t, s.conf.subnet.Bits(), ones) | <mask> t.Run("offer", func(t *testing.T) {
<mask> assert.Equal(t, dhcpv4.MessageTypeOffer, resp.MessageType())
<mask> assert.Equal(t, mac, resp.ClientHWAddr)
<mask> assert.True(t, l.IP.Equal(resp.YourIPAddr))
<mask> assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0]))
<mask> assert.True(t, s.conf.G... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice()))
assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice()))
ones, _ := resp.SubnetMask().Size()
assert.Equal(t, s.conf.subnet.Bits(), ones) | <mask> t.Run("ack", func(t *testing.T) {
<mask> assert.Equal(t, dhcpv4.MessageTypeAck, resp.MessageType())
<mask> assert.Equal(t, mac, resp.ClientHWAddr)
<mask> assert.True(t, l.IP.Equal(resp.YourIPAddr))
<mask> assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0]))
<mask> assert.True(t, s.conf.Gatew... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
assert.True(t, dnsAddrs[0].Equal(s.conf.GatewayIP.AsSlice())) | <mask>
<mask> dnsAddrs := resp.DNS()
<mask> require.Len(t, dnsAddrs, 1)
<mask>
<mask> assert.True(t, s.conf.GatewayIP.Equal(dnsAddrs[0]))
<mask>
<mask> t.Run("check_lease", func(t *testing.T) {
<mask> ls := s.GetLeases(LeasesStatic)
<mask> require.Len(t, ls, 1)
<mask>
</s> Pull request: Migrate t... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
s.conf.dnsIPAddrs = []netip.Addr{netip.MustParseAddr("192.168.10.1")}
s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs[0].AsSlice())) | <mask>
<mask> s, err := v4Create(conf)
<mask> require.NoError(t, err)
<mask>
<mask> s.conf.dnsIPAddrs = []net.IP{{192, 168, 10, 1}}
<mask> s.implicitOpts.Update(dhcpv4.OptDNS(s.conf.dnsIPAddrs...))
<mask>
<mask> var req, resp *dhcpv4.DHCPv4
<mask> mac := net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice()))
assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) | <mask> t.Run("offer", func(t *testing.T) {
<mask> assert.Equal(t, dhcpv4.MessageTypeOffer, resp.MessageType())
<mask> assert.Equal(t, mac, resp.ClientHWAddr)
<mask>
<mask> assert.Equal(t, s.conf.RangeStart, resp.YourIPAddr)
<mask> assert.Equal(t, s.conf.GatewayIP, resp.ServerIdentifier())
<mask>
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice())) | <mask>
<mask> router := resp.Router()
<mask> require.Len(t, router, 1)
<mask>
<mask> assert.Equal(t, s.conf.GatewayIP, router[0])
<mask>
<mask> assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask())
<mask> assert.Equal(t, s.conf.leaseTime.Seconds(), resp.IPAddressLeaseTime(-1).Seconds())
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
ones, _ := resp.SubnetMask().Size()
assert.Equal(t, s.conf.subnet.Bits(), ones) | <mask> require.Len(t, router, 1)
<mask>
<mask> assert.Equal(t, s.conf.GatewayIP, router[0])
<mask>
<mask> assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask())
<mask> assert.Equal(t, s.conf.leaseTime.Seconds(), resp.IPAddressLeaseTime(-1).Seconds())
<mask> assert.Equal(t, []byte("012"), resp.Options... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) | <mask>
<mask> t.Run("ack", func(t *testing.T) {
<mask> assert.Equal(t, dhcpv4.MessageTypeAck, resp.MessageType())
<mask> assert.Equal(t, mac, resp.ClientHWAddr)
<mask> assert.True(t, s.conf.RangeStart.Equal(resp.YourIPAddr))
<mask>
<mask> router := resp.Router()
<mask> require.Len(t, router, 1)
<m... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
assert.True(t, router[0].Equal(s.conf.GatewayIP.AsSlice()))
assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) | <mask>
<mask> router := resp.Router()
<mask> require.Len(t, router, 1)
<mask>
<mask> assert.Equal(t, s.conf.GatewayIP, router[0])
<mask>
<mask> assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier()))
<mask> assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask())
<mask> assert.Equal(t, s.c... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
ones, _ := resp.SubnetMask().Size()
assert.Equal(t, s.conf.subnet.Bits(), ones) | <mask> require.Len(t, router, 1)
<mask>
<mask> assert.Equal(t, s.conf.GatewayIP, router[0])
<mask>
<mask> assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier()))
<mask> assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask())
<mask> assert.Equal(t, s.conf.leaseTime.Seconds(), resp.IPAddressLeas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dhcpd/v4_unix_test.go |
// TODO(e.burkov): Use map[netip.Addr]struct{} instead. | <mask>
<mask> // accessCtx controls IP and client blocking that takes place before all other
<mask> // processing. An accessCtx is safe for concurrent use.
<mask> type accessCtx struct {
<mask> allowedIPs *netutil.IPMap
<mask> blockedIPs *netutil.IPMap
<mask>
<mask> allowedClientIDs *stringutil.Set
</s> ... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dnsforward/access.go |
// TODO(e.burkov): Use map[netip.Addr]struct{} instead. | <mask>
<mask> tableHostToIP hostToIPTable
<mask> tableHostToIPLock sync.Mutex
<mask>
<mask> tableIPToHost *netutil.IPMap
<mask> tableIPToHostLock sync.Mutex
<mask>
<mask> // clientIDCache is a temporary storage for ClientIDs that were extracted
</s> Pull request: Migrate to netip.Addr vol.1
Me... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/dnsforward/dnsforward.go |
//
// TODO(e.burkov): Use map[netip.Addr]struct{} instead. | <mask>
<mask> // ipToRC is the IP address to *RuntimeClient map.
<mask> ipToRC *netutil.IPMap
<mask>
<mask> lock sync.Mutex
<mask>
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/clients.go |
"net/netip" | <mask>
<mask> import (
<mask> "net"
<mask> "os"
<mask> "runtime"
<mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashe... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/clients_test.go |
GatewayIP: netip.MustParseAddr("1.2.3.1"),
SubnetMask: netip.MustParseAddr("255.255.255.0"),
RangeStart: netip.MustParseAddr("1.2.3.2"),
RangeEnd: netip.MustParseAddr("1.2.3.10"), | <mask> Enabled: true,
<mask> DBFilePath: "leases.db",
<mask> Conf4: dhcpd.V4ServerConf{
<mask> Enabled: true,
<mask> GatewayIP: net.IP{1, 2, 3, 1},
<mask> SubnetMask: net.IP{255, 255, 255, 0},
<mask> RangeStart: net.IP{1, 2, 3, 2},
<mask> RangeEnd: net.IP{1, 2, 3, 10},
<ma... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/clients_test.go |
"net/netip" | <mask>
<mask> import (
<mask> "bytes"
<mask> "fmt"
<mask> "net"
<mask> "os"
<mask> "path/filepath"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghalg"
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Upd... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/config.go |
// BindHost is the address for the web interface server to listen on.
BindHost netip.Addr `yaml:"bind_host"`
// BindPort is the port for the web interface server to listen on.
BindPort int `yaml:"bind_port"`
// BetaBindPort is the port for the new client's web interface server to
// listen on.
BetaBindPort int `... | <mask> // Raw file data to avoid re-reading of configuration file
<mask> // It's reset after config is parsed
<mask> fileData []byte
<mask>
<mask> BindHost net.IP `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to
<mask> BindPort int `yaml:"bind_port"` ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/config.go |
AuthBlockMin uint `yaml:"block_auth_min"`
// ProxyURL is the address of proxy server for the internal HTTP client.
ProxyURL string `yaml:"http_proxy"`
// Language is a two-letter ISO 639-1 language code.
Language string `yaml:"language"`
// DebugPProf defines if the profiling HTTP handler will listen on :6060.
D... | <mask> // can do before being blocked.
<mask> AuthAttempts uint `yaml:"auth_attempts"`
<mask> // AuthBlockMin is the duration, in minutes, of the block of new login
<mask> // attempts after AuthAttempts unsuccessful login attempts.
<mask> AuthBlockMin uint `yaml:"block_auth_min"`
<mask> ProxyURL strin... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/config.go |
// migration. Also keep the blocked services in mind. | <mask> // cloned from the filtering module back here.
<mask> //
<mask> // TODO(e.burkov): Move all the filtering configuration fields into the
<mask> // only configuration subsection covering the changes with a single
<mask> // migration.
<mask> Filters []filtering.FilterYAML `yaml:"filters"`
<ma... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/config.go |
BindHosts []netip.Addr `yaml:"bind_hosts"`
Port int `yaml:"port"` | <mask> }
<mask>
<mask> // field ordering is important -- yaml fields will mirror ordering from here
<mask> type dnsConfig struct {
<mask> BindHosts []net.IP `yaml:"bind_hosts"`
<mask> Port int `yaml:"port"`
<mask>
<mask> // time interval for statistics (in days)
<mask> StatsInterval uint32 `yam... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/config.go |
// StatsInterval is the time interval for flushing statistics to the disk in
// days. | <mask> type dnsConfig struct {
<mask> BindHosts []net.IP `yaml:"bind_hosts"`
<mask> Port int `yaml:"port"`
<mask>
<mask> // time interval for statistics (in days)
<mask> StatsInterval uint32 `yaml:"statistics_interval"`
<mask>
<mask> QueryLogEnabled bool `yaml:"querylog_enabled"` // if... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/config.go |
// QueryLogEnabled defines if the query log is enabled.
QueryLogEnabled bool `yaml:"querylog_enabled"`
// QueryLogFileEnabled defines, if the query log is written to the file.
QueryLogFileEnabled bool `yaml:"querylog_file_enabled"` | <mask>
<mask> // time interval for statistics (in days)
<mask> StatsInterval uint32 `yaml:"statistics_interval"`
<mask>
<mask> QueryLogEnabled bool `yaml:"querylog_enabled"` // if true, query log is enabled
<mask> QueryLogFileEnabled bool `yaml:"querylog_file_enabled"` // if true, query log will be... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/config.go |
QueryLogInterval timeutil.Duration `yaml:"querylog_interval"`
// QueryLogMemSize is the number of entries kept in memory before they are
// flushed to disk.
QueryLogMemSize uint32 `yaml:"querylog_size_memory"`
// AnonymizeClientIP defines if clients' IP addresses should be anonymized
// in query log and statisti... | <mask>
<mask> QueryLogEnabled bool `yaml:"querylog_enabled"` // if true, query log is enabled
<mask> QueryLogFileEnabled bool `yaml:"querylog_file_enabled"` // if true, query log will be written to a file
<mask> // QueryLogInterval is the interval for query log's files rotation.
<mask> QueryLogInterv... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/config.go |
BindHost: netip.IPv4Unspecified(), | <mask> // TODO(a.garipov, e.burkov): This global is awful and must be removed.
<mask> var config = &configuration{
<mask> BindPort: 3000,
<mask> BetaBindPort: 0,
<mask> BindHost: net.IP{0, 0, 0, 0},
<mask> AuthAttempts: 5,
<mask> AuthBlockMin: 15,
<mask> WebSessionTTL... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/config.go |
BindHosts: []netip.Addr{netip.IPv4Unspecified()}, | <mask> AuthAttempts: 5,
<mask> AuthBlockMin: 15,
<mask> WebSessionTTLHours: 30 * 24,
<mask> DNS: dnsConfig{
<mask> BindHosts: []net.IP{{0, 0, 0, 0}},
<mask> Port: defaultPortDNS,
<mask> StatsInterval: 1,
<mask> QueryLogEnabled: true,
<mask> QueryLogF... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/config.go |
<mask> package home
<mask>
<mask> import (
<mask> "fmt"
<mask> "net"
<mask> "net/http"
<mask> "net/url"
<mask> "runtime"
<mask> "strings"
<mask> "time"
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/control.go | |
"net/netip" | <mask> "fmt"
<mask> "net/http"
<mask> "net/url"
<mask> "runtime"
<mask> "strings"
<mask> "time"
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/control.go |
func appendDNSAddrs(dst []string, addrs ...netip.Addr) (res []string) { | <mask> )
<mask>
<mask> // appendDNSAddrs is a convenient helper for appending a formatted form of DNS
<mask> // addresses to a slice of strings.
<mask> func appendDNSAddrs(dst []string, addrs ...net.IP) (res []string) {
<mask> for _, addr := range addrs {
<mask> var hostport string
<mask> if config.DNS.Po... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/control.go |
hostport = netip.AddrPortFrom(addr, uint16(config.DNS.Port)).String() | <mask> func appendDNSAddrs(dst []string, addrs ...net.IP) (res []string) {
<mask> for _, addr := range addrs {
<mask> var hostport string
<mask> if config.DNS.Port != defaultPortDNS {
<mask> hostport = netutil.JoinHostPort(addr.String(), config.DNS.Port)
<mask> } else {
<mask> hostport = addr.String... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/control.go |
func appendDNSAddrsWithIfaces(dst []string, src []netip.Addr) (res []string, err error) { | <mask>
<mask> // appendDNSAddrsWithIfaces formats and appends all DNS addresses from src to
<mask> // dst. It also adds the IP addresses of all network interfaces if src contains
<mask> // an unspecified IP address.
<mask> func appendDNSAddrsWithIfaces(dst []string, src []net.IP) (res []string, err error) {
<ma... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/control.go |
addr := aghnet.IPv4Localhost()
addrs = appendDNSAddrs(addrs, addr) | <mask> // collectDNSAddresses returns the list of DNS addresses the server is listening
<mask> // on, including the addresses on all interfaces in cases of unspecified IPs.
<mask> func collectDNSAddresses() (addrs []string, err error) {
<mask> if hosts := config.DNS.BindHosts; len(hosts) == 0 {
<mask> addrs = a... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/control.go |
<mask> "context"
<mask> "encoding/json"
<mask> "fmt"
<mask> "io"
<mask> "net"
<mask> "net/http"
<mask> "os"
<mask> "os/exec"
<mask> "path/filepath"
<mask> "runtime"
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
S... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go | |
"net/netip" | <mask> "encoding/json"
<mask> "fmt"
<mask> "io"
<mask> "net/http"
<mask> "os"
<mask> "os/exec"
<mask> "path/filepath"
<mask> "runtime"
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
IP netip.Addr `json:"ip"`
Port int `json:"port"`
Autofix bool `json:"autofix"` | <mask> _ = aghhttp.WriteJSONResponse(w, r, data)
<mask> }
<mask>
<mask> type checkConfReqEnt struct {
<mask> IP net.IP `json:"ip"`
<mask> Port int `json:"port"`
<mask> Autofix bool `json:"autofix"`
<mask> }
<mask>
<mask> type checkConfReq struct {
<mask> Web checkConfReqEnt `json:... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) | <mask> // Go on and check the port binding only if it's not zero or won't be
<mask> // unbound after install.
<mask> }
<mask>
<mask> return aghnet.CheckPort("tcp", req.Web.IP, portInt)
<mask> }
<mask>
<mask> // validateDNS returns error if the DNS part of the initial configuration can't
<mask> // be se... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) | <mask> if err = tcpPorts.Validate(); err != nil {
<mask> return false, err
<mask> }
<mask>
<mask> err = aghnet.CheckPort("tcp", req.DNS.IP, port)
<mask> if err != nil {
<mask> return false, err
<mask> }
<mask> }
<mask>
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-ho... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) | <mask> return false, err
<mask> }
<mask> }
<mask>
<mask> err = aghnet.CheckPort("udp", req.DNS.IP, port)
<mask> if !aghnet.IsAddrInUse(err) {
<mask> return false, err
<mask> }
<mask>
<mask> // Try to fix automatically.
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home fr... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(port))) | <mask> if derr := disableDNSStubListener(); derr != nil {
<mask> log.Error("disabling DNSStubListener: %s", err)
<mask> }
<mask>
<mask> err = aghnet.CheckPort("udp", req.DNS.IP, port)
<mask> canAutofix = false
<mask> }
<mask>
<mask> return canAutofix, err
<mask> }
</s> Pull request: Migrate to... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
func handleStaticIP(ip netip.Addr, set bool) staticIPJSON { | <mask>
<mask> // handleStaticIP - handles static IP request
<mask> // It either checks if we have a static IP
<mask> // Or if set=true, it tries to set it
<mask> func handleStaticIP(ip net.IP, set bool) staticIPJSON {
<mask> resp := staticIPJSON{}
<mask>
<mask> interfaceName := aghnet.InterfaceByIP(ip)
<ma... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
IP netip.Addr `json:"ip"`
Port int `json:"port"` | <mask> return nil
<mask> }
<mask>
<mask> type applyConfigReqEnt struct {
<mask> IP net.IP `json:"ip"`
<mask> Port int `json:"port"`
<mask> }
<mask>
<mask> type applyConfigReq struct {
<mask> Username string `json:"username"`
<mask> Password string `json:"password"`
</s> Pull request: Migrate to ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
err = aghnet.CheckPort("udp", netip.AddrPortFrom(req.DNS.IP, uint16(req.DNS.Port))) | <mask>
<mask> return
<mask> }
<mask>
<mask> err = aghnet.CheckPort("udp", req.DNS.IP, req.DNS.Port)
<mask> if err != nil {
<mask> aghhttp.Error(r, w, http.StatusBadRequest, "%s", err)
<mask>
<mask> return
<mask> }
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 292... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.DNS.IP, uint16(req.DNS.Port))) | <mask>
<mask> return
<mask> }
<mask>
<mask> err = aghnet.CheckPort("tcp", req.DNS.IP, req.DNS.Port)
<mask> if err != nil {
<mask> aghhttp.Error(r, w, http.StatusBadRequest, "%s", err)
<mask>
<mask> return
<mask> }
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 292... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
config.DNS.BindHosts = []netip.Addr{req.DNS.IP} | <mask>
<mask> Context.firstRun = false
<mask> config.BindHost = req.Web.IP
<mask> config.BindPort = req.Web.Port
<mask> config.DNS.BindHosts = []net.IP{req.DNS.IP}
<mask> config.DNS.Port = req.DNS.Port
<mask>
<mask> // TODO(e.burkov): StartMods() should be put in a separate goroutine at the
<mask> // ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port | <mask> if req.Web.Port == 0 || req.DNS.Port == 0 {
<mask> return nil, false, errors.Error("ports cannot be 0")
<mask> }
<mask>
<mask> restartHTTP = !config.BindHost.Equal(req.Web.IP) || config.BindPort != req.Web.Port
<mask> if restartHTTP {
<mask> err = aghnet.CheckPort("tcp", req.Web.IP, req.Web.Port)... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(req.Web.Port))) | <mask> }
<mask>
<mask> restartHTTP = !config.BindHost.Equal(req.Web.IP) || config.BindPort != req.Web.Port
<mask> if restartHTTP {
<mask> err = aghnet.CheckPort("tcp", req.Web.IP, req.Web.Port)
<mask> if err != nil {
<mask> return nil, false, fmt.Errorf(
<mask> "checking address %s:%d: %w",
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
IP []netip.Addr `json:"ip"`
Port int `json:"port"`
Autofix bool `json:"autofix"` | <mask> //
<mask> // TODO(e.burkov): This should removed with the API v1 when the appropriate
<mask> // functionality will appear in default checkConfigReqEnt.
<mask> type checkConfigReqEntBeta struct {
<mask> IP []net.IP `json:"ip"`
<mask> Port int `json:"port"`
<mask> Autofix bool `json:"aut... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
IP []netip.Addr `json:"ip"`
Port int `json:"port"` | <mask> //
<mask> // TODO(e.burkov): This should removed with the API v1 when the appropriate
<mask> // functionality will appear in default applyConfigReqEnt.
<mask> type applyConfigReqEntBeta struct {
<mask> IP []net.IP `json:"ip"`
<mask> Port int `json:"port"`
<mask> }
<mask>
<mask> // applyConfigR... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/controlinstall.go |
"net/netip" | <mask> import (
<mask> "fmt"
<mask> "net"
<mask> "net/url"
<mask> "os"
<mask> "path/filepath"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed c... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/dns.go |
func ipsToTCPAddrs(ips []netip.Addr, port int) (tcpAddrs []*net.TCPAddr) { | <mask> Context.whois.Begin(ip)
<mask> }
<mask> }
<mask>
<mask> func ipsToTCPAddrs(ips []net.IP, port int) (tcpAddrs []*net.TCPAddr) {
<mask> if ips == nil {
<mask> return nil
<mask> }
<mask>
<mask> tcpAddrs = make([]*net.TCPAddr, len(ips))
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DN... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/dns.go |
tcpAddrs = make([]*net.TCPAddr, 0, len(ips))
for _, ip := range ips {
tcpAddrs = append(tcpAddrs, net.TCPAddrFromAddrPort(netip.AddrPortFrom(ip, uint16(port)))) | <mask> if ips == nil {
<mask> return nil
<mask> }
<mask>
<mask> tcpAddrs = make([]*net.TCPAddr, len(ips))
<mask> for i, ip := range ips {
<mask> tcpAddrs[i] = &net.TCPAddr{
<mask> IP: ip,
<mask> Port: port,
<mask> }
<mask> }
<mask>
<mask> return tcpAddrs
<mask> }
<mask>
</s> Pull ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/dns.go |
func ipsToUDPAddrs(ips []netip.Addr, port int) (udpAddrs []*net.UDPAddr) { | <mask>
<mask> return tcpAddrs
<mask> }
<mask>
<mask> func ipsToUDPAddrs(ips []net.IP, port int) (udpAddrs []*net.UDPAddr) {
<mask> if ips == nil {
<mask> return nil
<mask> }
<mask>
<mask> udpAddrs = make([]*net.UDPAddr, len(ips))
</s> Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-h... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/dns.go |
udpAddrs = make([]*net.UDPAddr, 0, len(ips))
for _, ip := range ips {
udpAddrs = append(udpAddrs, net.UDPAddrFromAddrPort(netip.AddrPortFrom(ip, uint16(port)))) | <mask> if ips == nil {
<mask> return nil
<mask> }
<mask>
<mask> udpAddrs = make([]*net.UDPAddr, len(ips))
<mask> for i, ip := range ips {
<mask> udpAddrs[i] = &net.UDPAddr{
<mask> IP: ip,
<mask> Port: port,
<mask> }
<mask> }
<mask>
<mask> return udpAddrs
<mask> }
<mask>
</s> Pull ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/dns.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.