|
|
@ -74,11 +74,9 @@ func (src *Node) Clone() *Node {
|
|
|
|
if dst.SelfNodeV6MasqAddrForThisPeer != nil {
|
|
|
|
if dst.SelfNodeV6MasqAddrForThisPeer != nil {
|
|
|
|
dst.SelfNodeV6MasqAddrForThisPeer = ptr.To(*src.SelfNodeV6MasqAddrForThisPeer)
|
|
|
|
dst.SelfNodeV6MasqAddrForThisPeer = ptr.To(*src.SelfNodeV6MasqAddrForThisPeer)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if src.ExitNodeDNSResolvers != nil {
|
|
|
|
dst.ExitNodeDNSResolvers = append([]*dnstype.Resolver(nil), make([]*dnstype.Resolver, len(src.ExitNodeDNSResolvers))...)
|
|
|
|
dst.ExitNodeDNSResolvers = make([]*dnstype.Resolver, len(src.ExitNodeDNSResolvers))
|
|
|
|
for i := range dst.ExitNodeDNSResolvers {
|
|
|
|
for i := range dst.ExitNodeDNSResolvers {
|
|
|
|
dst.ExitNodeDNSResolvers[i] = src.ExitNodeDNSResolvers[i].Clone()
|
|
|
|
dst.ExitNodeDNSResolvers[i] = src.ExitNodeDNSResolvers[i].Clone()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return dst
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -237,11 +235,9 @@ func (src *DNSConfig) Clone() *DNSConfig {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dst := new(DNSConfig)
|
|
|
|
dst := new(DNSConfig)
|
|
|
|
*dst = *src
|
|
|
|
*dst = *src
|
|
|
|
if src.Resolvers != nil {
|
|
|
|
dst.Resolvers = append([]*dnstype.Resolver(nil), make([]*dnstype.Resolver, len(src.Resolvers))...)
|
|
|
|
dst.Resolvers = make([]*dnstype.Resolver, len(src.Resolvers))
|
|
|
|
for i := range dst.Resolvers {
|
|
|
|
for i := range dst.Resolvers {
|
|
|
|
dst.Resolvers[i] = src.Resolvers[i].Clone()
|
|
|
|
dst.Resolvers[i] = src.Resolvers[i].Clone()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if dst.Routes != nil {
|
|
|
|
if dst.Routes != nil {
|
|
|
|
dst.Routes = map[string][]*dnstype.Resolver{}
|
|
|
|
dst.Routes = map[string][]*dnstype.Resolver{}
|
|
|
@ -249,11 +245,9 @@ func (src *DNSConfig) Clone() *DNSConfig {
|
|
|
|
dst.Routes[k] = append([]*dnstype.Resolver{}, src.Routes[k]...)
|
|
|
|
dst.Routes[k] = append([]*dnstype.Resolver{}, src.Routes[k]...)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if src.FallbackResolvers != nil {
|
|
|
|
dst.FallbackResolvers = append([]*dnstype.Resolver(nil), make([]*dnstype.Resolver, len(src.FallbackResolvers))...)
|
|
|
|
dst.FallbackResolvers = make([]*dnstype.Resolver, len(src.FallbackResolvers))
|
|
|
|
for i := range dst.FallbackResolvers {
|
|
|
|
for i := range dst.FallbackResolvers {
|
|
|
|
dst.FallbackResolvers[i] = src.FallbackResolvers[i].Clone()
|
|
|
|
dst.FallbackResolvers[i] = src.FallbackResolvers[i].Clone()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dst.Domains = append(src.Domains[:0:0], src.Domains...)
|
|
|
|
dst.Domains = append(src.Domains[:0:0], src.Domains...)
|
|
|
|
dst.Nameservers = append(src.Nameservers[:0:0], src.Nameservers...)
|
|
|
|
dst.Nameservers = append(src.Nameservers[:0:0], src.Nameservers...)
|
|
|
@ -387,11 +381,9 @@ func (src *DERPRegion) Clone() *DERPRegion {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dst := new(DERPRegion)
|
|
|
|
dst := new(DERPRegion)
|
|
|
|
*dst = *src
|
|
|
|
*dst = *src
|
|
|
|
if src.Nodes != nil {
|
|
|
|
dst.Nodes = append([]*DERPNode(nil), make([]*DERPNode, len(src.Nodes))...)
|
|
|
|
dst.Nodes = make([]*DERPNode, len(src.Nodes))
|
|
|
|
for i := range dst.Nodes {
|
|
|
|
for i := range dst.Nodes {
|
|
|
|
dst.Nodes[i] = src.Nodes[i].Clone()
|
|
|
|
dst.Nodes[i] = src.Nodes[i].Clone()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return dst
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -468,11 +460,9 @@ func (src *SSHRule) Clone() *SSHRule {
|
|
|
|
if dst.RuleExpires != nil {
|
|
|
|
if dst.RuleExpires != nil {
|
|
|
|
dst.RuleExpires = ptr.To(*src.RuleExpires)
|
|
|
|
dst.RuleExpires = ptr.To(*src.RuleExpires)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if src.Principals != nil {
|
|
|
|
dst.Principals = append([]*SSHPrincipal(nil), make([]*SSHPrincipal, len(src.Principals))...)
|
|
|
|
dst.Principals = make([]*SSHPrincipal, len(src.Principals))
|
|
|
|
for i := range dst.Principals {
|
|
|
|
for i := range dst.Principals {
|
|
|
|
dst.Principals[i] = src.Principals[i].Clone()
|
|
|
|
dst.Principals[i] = src.Principals[i].Clone()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dst.SSHUsers = maps.Clone(src.SSHUsers)
|
|
|
|
dst.SSHUsers = maps.Clone(src.SSHUsers)
|
|
|
|
dst.Action = src.Action.Clone()
|
|
|
|
dst.Action = src.Action.Clone()
|
|
|
|