mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-23 10:05:19 +00:00
Do not return a pointer
This commit is contained in:
parent
d70c3d6189
commit
5ce1526a06
2
app.go
2
app.go
@ -114,7 +114,7 @@ func NewHeadscale(cfg Config) (*Headscale, error) {
|
||||
return nil, err
|
||||
}
|
||||
h.cfg.DNSConfig.Routes = make(map[string][]dnstype.Resolver)
|
||||
for _, d := range *magicDNSDomains {
|
||||
for _, d := range magicDNSDomains {
|
||||
h.cfg.DNSConfig.Routes[d.WithoutTrailingDot()] = nil
|
||||
}
|
||||
}
|
||||
|
4
dns.go
4
dns.go
@ -28,7 +28,7 @@ import (
|
||||
|
||||
// From the netmask we can find out the wildcard bits (the bits that are not set in the netmask).
|
||||
// This allows us to then calculate the subnets included in the subsequent class block and generate the entries.
|
||||
func generateMagicDNSRootDomains(ipPrefix netaddr.IPPrefix, baseDomain string) (*[]dnsname.FQDN, error) {
|
||||
func generateMagicDNSRootDomains(ipPrefix netaddr.IPPrefix, baseDomain string) ([]dnsname.FQDN, error) {
|
||||
base, err := dnsname.ToFQDN(baseDomain)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -69,5 +69,5 @@ func generateMagicDNSRootDomains(ipPrefix netaddr.IPPrefix, baseDomain string) (
|
||||
}
|
||||
fqdns = append(fqdns, fqdn)
|
||||
}
|
||||
return &fqdns, nil
|
||||
return fqdns, nil
|
||||
}
|
||||
|
10
dns_test.go
10
dns_test.go
@ -11,7 +11,7 @@ func (s *Suite) TestMagicDNSRootDomains100(c *check.C) {
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
found := false
|
||||
for _, domain := range *domains {
|
||||
for _, domain := range domains {
|
||||
if domain == "64.100.in-addr.arpa." {
|
||||
found = true
|
||||
break
|
||||
@ -20,7 +20,7 @@ func (s *Suite) TestMagicDNSRootDomains100(c *check.C) {
|
||||
c.Assert(found, check.Equals, true)
|
||||
|
||||
found = false
|
||||
for _, domain := range *domains {
|
||||
for _, domain := range domains {
|
||||
if domain == "100.100.in-addr.arpa." {
|
||||
found = true
|
||||
break
|
||||
@ -29,7 +29,7 @@ func (s *Suite) TestMagicDNSRootDomains100(c *check.C) {
|
||||
c.Assert(found, check.Equals, true)
|
||||
|
||||
found = false
|
||||
for _, domain := range *domains {
|
||||
for _, domain := range domains {
|
||||
if domain == "127.100.in-addr.arpa." {
|
||||
found = true
|
||||
break
|
||||
@ -44,7 +44,7 @@ func (s *Suite) TestMagicDNSRootDomains172(c *check.C) {
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
found := false
|
||||
for _, domain := range *domains {
|
||||
for _, domain := range domains {
|
||||
if domain == "0.16.172.in-addr.arpa." {
|
||||
found = true
|
||||
break
|
||||
@ -53,7 +53,7 @@ func (s *Suite) TestMagicDNSRootDomains172(c *check.C) {
|
||||
c.Assert(found, check.Equals, true)
|
||||
|
||||
found = false
|
||||
for _, domain := range *domains {
|
||||
for _, domain := range domains {
|
||||
if domain == "255.16.172.in-addr.arpa." {
|
||||
found = true
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user