瀏覽代碼

check if wg pub listen port has been changed on host update

Abhishek Kondur 2 年之前
父節點
當前提交
4cde7080e5
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      logic/hosts.go

+ 4 - 0
logic/hosts.go

@@ -173,6 +173,10 @@ func UpdateHostFromClient(newHost, currHost *models.Host) (sendPeerUpdate bool)
 		currHost.ListenPort = newHost.ListenPort
 		sendPeerUpdate = true
 	}
+	if newHost.WgPublicListenPort != 0 && currHost.WgPublicListenPort != newHost.WgPublicListenPort {
+		currHost.WgPublicListenPort = newHost.WgPublicListenPort
+		sendPeerUpdate = true
+	}
 	if newHost.ProxyListenPort != 0 && currHost.ProxyListenPort != newHost.ProxyListenPort {
 		currHost.ProxyListenPort = newHost.ProxyListenPort
 		sendPeerUpdate = true