From bf5a5e16dc4e36d460cc144cdb7ce169d1282b34 Mon Sep 17 00:00:00 2001
From: Calvo <luis.calvo@artica.es>
Date: Mon, 26 Sep 2022 12:49:00 +0200
Subject: [PATCH] Fix agent edtion unique ip issues

---
 pandora_console/godmode/agentes/configurar_agente.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php
index af29579055..ace8b9c106 100644
--- a/pandora_console/godmode/agentes/configurar_agente.php
+++ b/pandora_console/godmode/agentes/configurar_agente.php
@@ -1047,7 +1047,7 @@ if ($update_agent) {
         // If there is an agent with the same name, but a different ID.
     }
 
-    if ($unique_ip && $direccion_agente != '') {
+    if ($direccion_agente !== $address_list && (bool) $unique_ip === true && $direccion_agente != '') {
         $sql = 'SELECT direccion FROM tagente WHERE direccion = "'.$direccion_agente.'"';
         $exists_ip  = db_get_row_sql($sql);
     }