Browse Source

skip self when interating through hosts

Matthew R Kasun 2 years ago
parent
commit
e314f6fb9e
1 changed files with 4 additions and 0 deletions
  1. 4 0
      logic/hosts.go

+ 4 - 0
logic/hosts.go

@@ -326,6 +326,10 @@ func CheckHostPorts(h *models.Host) {
 		return
 		return
 	}
 	}
 	for _, host := range hosts {
 	for _, host := range hosts {
+		if host.ID == h.ID {
+			//skip self
+			continue
+		}
 		if host.EndpointIP.Equal(h.EndpointIP) {
 		if host.EndpointIP.Equal(h.EndpointIP) {
 			if host.ListenPort == h.ListenPort || host.ProxyListenPort == h.ProxyListenPort ||
 			if host.ListenPort == h.ListenPort || host.ProxyListenPort == h.ProxyListenPort ||
 				host.ListenPort == h.ProxyListenPort || host.ProxyListenPort == h.ListenPort {
 				host.ListenPort == h.ProxyListenPort || host.ProxyListenPort == h.ListenPort {