From 5423a458c3bcef3b5f168eb8ca1f3b843f5935d0 Mon Sep 17 00:00:00 2001 From: Matthew R Kasun Date: Fri, 20 Jan 2023 13:29:19 -0500 Subject: [PATCH] review comments --- logic/hosts.go | 7 +++++++ models/host.go | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/logic/hosts.go b/logic/hosts.go index 94db3311..ccfcc053 100644 --- a/logic/hosts.go +++ b/logic/hosts.go @@ -327,6 +327,13 @@ func CheckHostPorts(h *models.Host) { return } for _, host := range hosts { + if host.ID == h.ID { + //skip self + continue + } + if !host.EndpointIP.Equal(h.EndpointIP) { + continue + } portsInUse[host.ListenPort] = true portsInUse[host.ProxyListenPort] = true } diff --git a/models/host.go b/models/host.go index e6efd1a1..743ce431 100644 --- a/models/host.go +++ b/models/host.go @@ -25,7 +25,6 @@ type Host struct { Debug bool `json:"debug" yaml:"debug"` ListenPort int `json:"listenport" yaml:"listenport"` PublicListenPort int `json:"public_listen_port" yaml:"public_listen_port"` - LocalListenPort int `json:"locallistenport" yaml:"locallistenport"` ProxyListenPort int `json:"proxy_listen_port" yaml:"proxy_listen_port"` MTU int `json:"mtu" yaml:"mtu"` PublicKey wgtypes.Key `json:"publickey" yaml:"publickey"`