Index: /branches/rel_ag_9_4_5/aaa/aaa_localdb.c
===================================================================
--- /branches/rel_ag_9_4_5/aaa/aaa_localdb.c	(revision 20368)
+++ /branches/rel_ag_9_4_5/aaa/aaa_localdb.c	(working copy)
@@ -9,6 +9,7 @@
 #include <sys/socket.h>
 #include <netdb.h>
 #include <arpa/inet.h>
+#include <regex.h>
 
 #define MAX_IPS 10
 #define MAX_BUFFER_SIZE 8192
@@ -18,6 +19,21 @@
     int count;
 } ip_list_t;
 
+int is_ip_format(const char *domain) {
+    const char *pattern = "^([0-9]{1,3}\\.){3}[0-9]{1,3}/[0-9.:-]+$";
+    regex_t regex;
+    int result;
+
+    if (regcomp(&regex, pattern, REG_EXTENDED | REG_NOSUB) != 0) {
+        return 0;
+    }
+
+    result = regexec(&regex, domain, 0, NULL, 0);
+    regfree(&regex);
+    
+    return result == 0;
+}
+
 /* resolve domain name to ip address */
 static ip_list_t 
 *resolve_domain_to_ipv4(char domain[128]) 
@@ -28,6 +44,12 @@
 	ip_list_t *ip_list = malloc(sizeof(ip_list_t));
 	ip_list->count = 0;
 
+	if (is_ip_format(domain))
+	{
+		aaa_debug_log("(%s): resource is already ip format (%s)", __FUNCTION__, domain);
+		return NULL;
+	}
+
 	memset(&hints, 0, sizeof(hints));
 	hints.ai_family = AF_INET;
 	hints.ai_socktype = SOCK_STREAM;
@@ -963,7 +985,7 @@
 			break;
 		}
     	}
-	aaa_debug_log("(%s): show vpn resource \"%s\"", __FUNCTION__, show_vpnres_output);
+	aaa_debug_log("(%s): %s \"%s\"", __FUNCTION__, cmd, show_vpnres_output);
 
 	/* add vpn resource with the output */
 	run_add_vpnres(show_vpnres_output, vsite, is_exclude);
