diff --git a/logic/hosts.go b/logic/hosts.go index 904bdb5fc..e53ed730b 100644 --- a/logic/hosts.go +++ b/logic/hosts.go @@ -198,7 +198,6 @@ func UpdateHost(newHost, currentHost *models.Host) { newHost.Debug = currentHost.Debug newHost.Nodes = currentHost.Nodes newHost.PublicKey = currentHost.PublicKey - newHost.InternetGateway = currentHost.InternetGateway newHost.TrafficKeyPublic = currentHost.TrafficKeyPublic // changeable fields diff --git a/models/api_host.go b/models/api_host.go index c71147fc2..4558a984b 100644 --- a/models/api_host.go +++ b/models/api_host.go @@ -23,7 +23,6 @@ type ApiHost struct { EndpointIP string `json:"endpointip" yaml:"endpointip"` PublicKey string `json:"publickey"` MacAddress string `json:"macaddress"` - InternetGateway string `json:"internetgateway"` Nodes []string `json:"nodes"` IsDefault bool `json:"isdefault" yaml:"isdefault"` IsRelayed bool `json:"isrelayed" bson:"isrelayed" yaml:"isrelayed"` @@ -45,10 +44,6 @@ func (h *Host) ConvertNMHostToAPI() *ApiHost { a.Interfaces[i].AddressString = a.Interfaces[i].Address.String() } a.DefaultInterface = h.DefaultInterface - a.InternetGateway = h.InternetGateway.String() - if isEmptyAddr(a.InternetGateway) { - a.InternetGateway = "" - } a.IsStatic = h.IsStatic a.ListenPort = h.ListenPort a.MTU = h.MTU @@ -83,7 +78,6 @@ func (a *ApiHost) ConvertAPIHostToNMHost(currentHost *Host) *Host { h.Interface = currentHost.Interface h.Interfaces = currentHost.Interfaces h.DefaultInterface = currentHost.DefaultInterface - h.InternetGateway = currentHost.InternetGateway h.IsDocker = currentHost.IsDocker h.IsK8S = currentHost.IsK8S h.IsStatic = a.IsStatic diff --git a/models/host.go b/models/host.go index 70947ba29..acd866848 100644 --- a/models/host.go +++ b/models/host.go @@ -55,7 +55,6 @@ type Host struct { PublicKey wgtypes.Key `json:"publickey" yaml:"publickey"` MacAddress net.HardwareAddr `json:"macaddress" yaml:"macaddress"` TrafficKeyPublic []byte `json:"traffickeypublic" yaml:"traffickeypublic"` - InternetGateway net.UDPAddr `json:"internetgateway" yaml:"internetgateway"` Nodes []string `json:"nodes" yaml:"nodes"` Interfaces []Iface `json:"interfaces" yaml:"interfaces"` DefaultInterface string `json:"defaultinterface" yaml:"defaultinterface"` diff --git a/models/node.go b/models/node.go index ba236cbea..a4104ac39 100644 --- a/models/node.go +++ b/models/node.go @@ -484,10 +484,6 @@ func (ln *LegacyNode) ConvertToNewNode() (*Host, *Node) { host.PublicKey, _ = wgtypes.ParseKey(ln.PublicKey) host.MacAddress, _ = net.ParseMAC(ln.MacAddress) host.TrafficKeyPublic = ln.TrafficKeys.Mine - gateway, err := net.ResolveUDPAddr("udp", ln.InternetGateway) - if err == nil { - host.InternetGateway = *gateway - } id, _ := uuid.Parse(ln.ID) host.Nodes = append(host.Nodes, id.String()) host.Interfaces = ln.Interfaces @@ -572,7 +568,6 @@ func (n *Node) Legacy(h *Host, s *ServerConfig, net *Network) *LegacyNode { l.TrafficKeys.Mine = h.TrafficKeyPublic l.TrafficKeys.Server = s.TrafficKey l.FirewallInUse = h.FirewallInUse - l.InternetGateway = h.InternetGateway.String() l.Connected = formatBool(n.Connected) //l.PendingDelete = formatBool(n.PendingDelete) l.DefaultACL = n.DefaultACL