wgengine/wgcfg: remove unused Config DNS and MTU fields
Nothing uses them. DNS and MTU are handled elsewhere. This is pulled out of a future change that removes wgcfg.Config.Peers, to make that PR smaller. Updates #12542 Change-Id: I2ec8ae38dc6cce08bcc44e6c1f9177311202af89 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
69ee776dfb
commit
b7de1753b7
@@ -19,8 +19,6 @@ import (
|
||||
type Config struct {
|
||||
PrivateKey key.NodePrivate
|
||||
Addresses []netip.Prefix
|
||||
MTU uint16
|
||||
DNS []netip.Addr
|
||||
Peers []Peer
|
||||
|
||||
// NetworkLogging enables network logging.
|
||||
@@ -38,10 +36,8 @@ func (c *Config) Equal(o *Config) bool {
|
||||
return c == o
|
||||
}
|
||||
return c.PrivateKey.Equal(o.PrivateKey) &&
|
||||
c.MTU == o.MTU &&
|
||||
c.NetworkLogging == o.NetworkLogging &&
|
||||
slices.Equal(c.Addresses, o.Addresses) &&
|
||||
slices.Equal(c.DNS, o.DNS) &&
|
||||
slices.EqualFunc(c.Peers, o.Peers, Peer.Equal)
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ func TestConfigEqual(t *testing.T) {
|
||||
rt := reflect.TypeFor[Config]()
|
||||
for sf := range rt.Fields() {
|
||||
switch sf.Name {
|
||||
case "Name", "NodeID", "PrivateKey", "MTU", "Addresses", "DNS", "Peers",
|
||||
case "Name", "NodeID", "PrivateKey", "Addresses", "Peers",
|
||||
"NetworkLogging":
|
||||
// These are compared in [Config.Equal].
|
||||
default:
|
||||
|
||||
@@ -21,7 +21,6 @@ func (src *Config) Clone() *Config {
|
||||
dst := new(Config)
|
||||
*dst = *src
|
||||
dst.Addresses = append(src.Addresses[:0:0], src.Addresses...)
|
||||
dst.DNS = append(src.DNS[:0:0], src.DNS...)
|
||||
if src.Peers != nil {
|
||||
dst.Peers = make([]Peer, len(src.Peers))
|
||||
for i := range dst.Peers {
|
||||
@@ -35,8 +34,6 @@ func (src *Config) Clone() *Config {
|
||||
var _ConfigCloneNeedsRegeneration = Config(struct {
|
||||
PrivateKey key.NodePrivate
|
||||
Addresses []netip.Prefix
|
||||
MTU uint16
|
||||
DNS []netip.Addr
|
||||
Peers []Peer
|
||||
NetworkLogging struct {
|
||||
NodeID logid.PrivateID
|
||||
|
||||
Reference in New Issue
Block a user