Index: /branches/ag_client_motionProGlobal_ios/motionpro_ios_mac/ImportFile/Info.plist
===================================================================
--- /branches/ag_client_motionProGlobal_ios/motionpro_ios_mac/ImportFile/Info.plist	(revision 8476)
+++ /branches/ag_client_motionProGlobal_ios/motionpro_ios_mac/ImportFile/Info.plist	(working copy)
@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>$(MARKETING_VERSION)</string>
 	<key>CFBundleVersion</key>
-	<string>141</string>
+	<string>143</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionAttributes</key>
Index: /branches/ag_client_motionProGlobal_ios/motionpro_ios_mac/MacTunnel.xcodeproj/project.pbxproj
===================================================================
--- /branches/ag_client_motionProGlobal_ios/motionpro_ios_mac/MacTunnel.xcodeproj/project.pbxproj	(revision 8476)
+++ /branches/ag_client_motionProGlobal_ios/motionpro_ios_mac/MacTunnel.xcodeproj/project.pbxproj	(working copy)
@@ -3364,7 +3364,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = net.arraynetworks.MotionProPlus.ImportFile;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
-				"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = MotionProGlobalDevforImportFile_240227;
+				"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = MotionProGlobalDevforImportFile_240301;
 				SDKROOT = iphoneos;
 				SKIP_INSTALL = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/ImportFile/ImportFile-Bridging-Header.h";
@@ -3402,7 +3402,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = net.arraynetworks.MotionProPlus.ImportFile;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
-				"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = MotionProGlobalDisforImportFile_240227;
+				"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = MotionProGlobalDisforImportFile_240301;
 				SDKROOT = iphoneos;
 				SKIP_INSTALL = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/ImportFile/ImportFile-Bridging-Header.h";
@@ -3553,7 +3553,7 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
 				PROVISIONING_PROFILE_SPECIFIER = "";
-				"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = MotionProGlobalDevforMac_240227;
+				"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = MotionProGlobalDevforMac_240301;
 				SDKROOT = macosx;
 			};
 			name = Debug;
@@ -3603,7 +3603,7 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
 				PROVISIONING_PROFILE_SPECIFIER = "";
-				"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = MotionProGlobalDisforMac_240227;
+				"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = MotionProGlobalDisforMac_240301;
 				SDKROOT = macosx;
 			};
 			name = Release;
@@ -3630,7 +3630,7 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
 				PROVISIONING_PROFILE_SPECIFIER = "";
-				"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = MotionProGlobalDevforArrayTunnel_240227;
+				"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = MotionProGlobalDevforArrayTunnel_240301;
 				SDKROOT = macosx;
 				SKIP_INSTALL = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "ArrayTunnel/ArrayTunnel-Bridging-Header.h";
@@ -3662,7 +3662,7 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
 				PROVISIONING_PROFILE_SPECIFIER = "";
-				"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = MotionProGlobalDisforArrayTunnel_240227;
+				"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = MotionProGlobalDisforArrayTunnel_240301;
 				SDKROOT = macosx;
 				SKIP_INSTALL = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "ArrayTunnel/ArrayTunnel-Bridging-Header.h";
@@ -3704,7 +3704,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = net.arraynetworks.MotionProPlus;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
-				"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = MotionProGlobalDevforIos_240227;
+				"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = MotionProGlobalDevforIos_240301;
 				SDKROOT = iphoneos;
 				SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/MotionProPlus/MotionProPlus-Bridging-Header.h";
 				SWIFT_VERSION = 4.2;
@@ -3747,7 +3747,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = net.arraynetworks.MotionProPlus;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
-				"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = MotionProGlobalDisforIos_240227;
+				"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = MotionProGlobalDisforIOS_240301;
 				SDKROOT = iphoneos;
 				SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/MotionProPlus/MotionProPlus-Bridging-Header.h";
 				SWIFT_VERSION = 4.2;
@@ -3779,7 +3779,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = net.arraynetworks.MotionProPlus.iOSTunnel;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
-				"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = MotionProGlobalDevforIosTunnel_240227;
+				"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = MotionProGlobalDevforIosTunnel_240301;
 				SDKROOT = iphoneos;
 				SKIP_INSTALL = YES;
 				TARGETED_DEVICE_FAMILY = "1,2";
@@ -3808,7 +3808,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = net.arraynetworks.MotionProPlus.iOSTunnel;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
-				"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = MotionProGlobalDisforIosTunnel_240227;
+				"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = MotionProGlobalDisforIosTunnel_240301;
 				SDKROOT = iphoneos;
 				SKIP_INSTALL = YES;
 				TARGETED_DEVICE_FAMILY = "1,2";
Index: /branches/ag_client_motionProGlobal_ios/motionpro_ios_mac/MotionProPlus/Info.plist
===================================================================
--- /branches/ag_client_motionProGlobal_ios/motionpro_ios_mac/MotionProPlus/Info.plist	(revision 8476)
+++ /branches/ag_client_motionProGlobal_ios/motionpro_ios_mac/MotionProPlus/Info.plist	(working copy)
@@ -32,7 +32,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>141</string>
+	<string>143</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
 	<key>LSApplicationQueriesSchemes</key>
Index: /branches/ag_client_motionProGlobal_ios/motionpro_ios_mac/iOSTunnel/Info.plist
===================================================================
--- /branches/ag_client_motionProGlobal_ios/motionpro_ios_mac/iOSTunnel/Info.plist	(revision 8476)
+++ /branches/ag_client_motionProGlobal_ios/motionpro_ios_mac/iOSTunnel/Info.plist	(working copy)
@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>$(MARKETING_VERSION)</string>
 	<key>CFBundleVersion</key>
-	<string>141</string>
+	<string>143</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionPointIdentifier</key>
Index: /branches/ag_client_motionProGlobal_ios/motionpro_sdk_mobile/vl3vpn/l3vpn/common.h
===================================================================
--- /branches/ag_client_motionProGlobal_ios/motionpro_sdk_mobile/vl3vpn/l3vpn/common.h	(revision 8416)
+++ /branches/ag_client_motionProGlobal_ios/motionpro_sdk_mobile/vl3vpn/l3vpn/common.h	(working copy)
@@ -534,4 +534,4 @@
 
 // buf's length must >= SHA_DIGEST_LENGTH (20)
 int get_cert_fingerprint(X509* cert, char* buf);
-int is_skip_sdk_session_check();
\ No newline at end of file
+int is_skip_sdk_session_check();
Index: /branches/ag_client_motionProGlobal_ios/motionpro_sdk_mobile/vl3vpn/l3vpn/common.c
===================================================================
--- /branches/ag_client_motionProGlobal_ios/motionpro_sdk_mobile/vl3vpn/l3vpn/common.c	(revision 8416)
+++ /branches/ag_client_motionProGlobal_ios/motionpro_sdk_mobile/vl3vpn/l3vpn/common.c	(working copy)
@@ -1161,9 +1161,12 @@
             seconds = sess->conn_timeout[sess->conn_timeout_idx];
         }
     }
-
+    Log(LOG_INFO, "mytest| seconds: %d", seconds);
     if (seconds == 0) {
+        Log(LOG_INFO, "mytest| fd: %d, addr: {%u %u %s}", fd, addr->sa_len, addr->sa_family, addr->sa_data);
+        Log(LOG_INFO, "mytest===========sock_connect_timeout2| IP: %d.%d.%d.%d", IP2BYTES(addr->sa_data));
         ret = connect(fd, addr, addrlen);
+        Log(LOG_INFO, "mytest| connect result: %d", ret);
         return (ret == 0) ? ERR_SUCCESS : ERR_SOCK_CONN;
     }
 
@@ -1301,7 +1304,19 @@
 	}
 
 	if(sess->addr.sin_addr.s_addr != 0) {
-    	ret = sock_connect_timeout(sess, sess->sock, (struct sockaddr*)&sess->addr, sizeof(sess->addr));
+        Log(LOG_INFO, "mytest| sess.addr: { sin_len:%u sin_family:%u sin_port:%hu s_addr:%u sin_zero:%s }",
+            sess->addr.sin_len,
+            sess->addr.sin_family,
+            sess->addr.sin_port,
+            sess->addr.sin_addr.s_addr,
+            sess->addr.sin_zero
+            );
+        Log(LOG_INFO, "mytest===========sock_connect sockaddr_in| IP: %d.%d.%d.%d", IP2BYTES(sess->addr.sin_addr.s_addr));
+        struct sockaddr* test_st = (struct sockaddr*)&sess->addr;
+        Log(LOG_INFO, "mytest===========sock_connect sockaddr| IP: %d.%d.%d.%d", IP2BYTES(test_st->sa_data));
+        Log(LOG_INFO, "mytest| test_st: {%u %u %s}", test_st->sa_len, test_st->sa_family, test_st->sa_data);
+        ret = sock_connect_timeout(sess, sess->sock, test_st, sizeof(sess->addr));
+    	//ret = sock_connect_timeout(sess, sess->sock, (struct sockaddr*)&sess->addr, sizeof(sess->addr));
 	} else {
 		ret = sock_connect_timeout(sess, sess->sock, (struct sockaddr*)&sess->addr6, sizeof(sess->addr6));
 	}
Index: /branches/ag_client_motionProGlobal_ios/motionpro_sdk_mobile/vl3vpn/l3vpn/main.c
===================================================================
--- /branches/ag_client_motionProGlobal_ios/motionpro_sdk_mobile/vl3vpn/l3vpn/main.c	(revision 8416)
+++ /branches/ag_client_motionProGlobal_ios/motionpro_sdk_mobile/vl3vpn/l3vpn/main.c	(working copy)
@@ -1,4 +1,4 @@
-﻿#ifndef _WINDLL
+#ifndef _WINDLL
 #ifdef _WIN32
 #define _CRT_SECURE_NO_WARNINGS
 #include <io.h>
Index: /branches/ag_client_motionProGlobal_ios/motionpro_sdk_mobile/vl3vpn/l3vpn/osal_posix.c
===================================================================
--- /branches/ag_client_motionProGlobal_ios/motionpro_sdk_mobile/vl3vpn/l3vpn/osal_posix.c	(revision 8416)
+++ /branches/ag_client_motionProGlobal_ios/motionpro_sdk_mobile/vl3vpn/l3vpn/osal_posix.c	(working copy)
@@ -16,11 +16,11 @@
 #include <signal.h>
 #include <net/if.h>
 
-#ifndef __ANDROID__
-#include <ifaddrs.h>
-#else
-#include <sys/ioctl.h>
-#include <arpa/inet.h>
+#ifndef __ANDROID__
+#include <ifaddrs.h>
+#else
+#include <sys/ioctl.h>
+#include <arpa/inet.h>
 #endif
 
 #ifdef __APPLE__
@@ -160,7 +160,7 @@
 #else
 
 int is_app_port_internal(uint16_t port, int type, int *result)
-{
+{
 #if (!TARGET_OS_IPHONE) && (!TARGET_IPHONE_SIMULATOR) && TARGET_OS_MAC
     int pid = getpid();
 
@@ -205,38 +205,38 @@
     return 1;
 #endif
 }
-
-int ps_get_port_pid(uint16_t port, int udp, int *pid, int *ppid)
-{
-    FILE  *fp = NULL;
-    char   buf[256] = { 0 };
-    char   cmd[1024] = { 0 };
-    int    self = getpid();
-    char   *p;
-
-    snprintf(cmd, sizeof(cmd), "lsof -i 4%s@127.0.0.1:%d -p ``^%d'' -R | awk '{print $2,$3}'",
-        udp?"UDP":"TCP", (int)port, self);
-    if ((fp = popen(cmd, "r")) == NULL){
-        return 0;
-    }
-
-    if (fread(buf, 1, sizeof(buf) - 1, fp) <= 0) {
-        pclose(fp);
-        return 0;
-    }
-
-    pclose(fp);
-
-    p = strchr(buf, '\n');
-    if (!p) return 0;
-    p++;
-    if (pid) *pid = strtol(p, NULL, 10);
-
-    p = strchr(p, ' ');
-    if (!p) return 0;
-    if (ppid) *ppid = strtol(p, NULL, 10);
-
-    return 1;
+
+int ps_get_port_pid(uint16_t port, int udp, int *pid, int *ppid)
+{
+    FILE  *fp = NULL;
+    char   buf[256] = { 0 };
+    char   cmd[1024] = { 0 };
+    int    self = getpid();
+    char   *p;
+
+    snprintf(cmd, sizeof(cmd), "lsof -i 4%s@127.0.0.1:%d -p ``^%d'' -R | awk '{print $2,$3}'",
+        udp?"UDP":"TCP", (int)port, self);
+    if ((fp = popen(cmd, "r")) == NULL){
+        return 0;
+    }
+
+    if (fread(buf, 1, sizeof(buf) - 1, fp) <= 0) {
+        pclose(fp);
+        return 0;
+    }
+
+    pclose(fp);
+
+    p = strchr(buf, '\n');
+    if (!p) return 0;
+    p++;
+    if (pid) *pid = strtol(p, NULL, 10);
+
+    p = strchr(p, ' ');
+    if (!p) return 0;
+    if (ppid) *ppid = strtol(p, NULL, 10);
+
+    return 1;
 }
 
 int is_app_tcp_port(uint16_t port, int *result)
@@ -729,6 +729,7 @@
 	int nLen = sizeof(addrin);
 	int count =0;
 	
+    Log(LOG_INFO, "mytest| get local mac address\n");
 	getsockname(sock, (struct sockaddr*)&addrin, (socklen_t *)&nLen);
 	strncpy(localipaddr, inet_ntoa(addrin.sin_addr), sizeof(localipaddr)-1);
 	int socketfd = socket(AF_INET,SOCK_DGRAM,0);
@@ -779,99 +780,99 @@
 #endif
 #endif
 
-int get_local_address(uint32_t *addrs, uint8_t max_count)
-{
-    struct ifaddrs      *ifaddr;
-    struct ifaddrs      *ifa;
-    struct sockaddr_in  *addr;
-    int                  i = 0;
+int get_local_address(uint32_t *addrs, uint8_t max_count)
+{
+    struct ifaddrs      *ifaddr;
+    struct ifaddrs      *ifa;
+    struct sockaddr_in  *addr;
+    int                  i = 0;
 	uint32_t             local_virtual_ip = 0;
 	local_virtual_ip = addrs[0];
 	Log(LOG_INFO, "get_local_address:(ios) current virtual ip[%d.%d.%d.%d], need ignore it.\n", IP2BYTES(local_virtual_ip));
 	addrs[0] = 0;
-
-    if (getifaddrs(&ifaddr) == -1) return 0;
-
-    for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
-        if (ifa->ifa_addr == NULL) continue;
-        if (ifa->ifa_addr->sa_family != AF_INET) continue;
-        if(ifa->ifa_flags & IFF_LOOPBACK) continue;
-        if(!(ifa->ifa_flags & IFF_UP)) continue;
-        if(!(ifa->ifa_flags & IFF_RUNNING)) continue;
-
-        addr = (struct sockaddr_in*)ifa->ifa_addr;
+
+    if (getifaddrs(&ifaddr) == -1) return 0;
+
+    for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
+        if (ifa->ifa_addr == NULL) continue;
+        if (ifa->ifa_addr->sa_family != AF_INET) continue;
+        if(ifa->ifa_flags & IFF_LOOPBACK) continue;
+        if(!(ifa->ifa_flags & IFF_UP)) continue;
+        if(!(ifa->ifa_flags & IFF_RUNNING)) continue;
+
+        addr = (struct sockaddr_in*)ifa->ifa_addr;
 		if (local_virtual_ip == addr->sin_addr.s_addr)
 		{
 			Log(LOG_INFO, "get_local_address: ignore it!\n");
 			continue;
 		}
-        addrs[i++] = addr->sin_addr.s_addr;
-        if (i == max_count) break;        
-    }
-
-    if (ifaddr) freeifaddrs(ifaddr);
+        addrs[i++] = addr->sin_addr.s_addr;
+        if (i == max_count) break;        
+    }
+
+    if (ifaddr) freeifaddrs(ifaddr);
     return i;
 }
 #else
-int get_local_address(uint32_t *addrs, uint8_t max_count)
-{
-    int                  i;
-    int                  j;
-    struct ifreq        *ifr;
-    struct ifconf        ifc;
-    struct sockaddr_in  *addr;
-    int                  fd;
-    int                  count;
-    int                  loopback = inet_addr("127.0.0.1");
+int get_local_address(uint32_t *addrs, uint8_t max_count)
+{
+    int                  i;
+    int                  j;
+    struct ifreq        *ifr;
+    struct ifconf        ifc;
+    struct sockaddr_in  *addr;
+    int                  fd;
+    int                  count;
+    int                  loopback = inet_addr("127.0.0.1");
     uint32_t             local_virtual_ip = 0;
     local_virtual_ip = addrs[0];
     Log(LOG_INFO, "get_local_address:(android) current virtual ip[%d.%d.%d.%d], need ignore it.\n", IP2BYTES(local_virtual_ip));
     addrs[0] = 0;
-
-    memset(&ifc, 0, sizeof(ifc));
-    ifc.ifc_ifcu.ifcu_req = NULL;
-    ifc.ifc_len = 0;
-
-    fd = socket(AF_INET, SOCK_DGRAM, 0);
-    if (fd < 0) return 0;
-
-    if (ioctl(fd, SIOCGIFCONF, &ifc) < 0) {
-        close(fd);
-        return 0;
-    }
-
-    ifr = malloc(ifc.ifc_len);
-    if (ifr == NULL) {
-        close(fd);
-        return 0;
-    }
-
-    ifc.ifc_ifcu.ifcu_req = ifr;
-    if (ioctl(fd, SIOCGIFCONF, &ifc) < 0) {
-        close(fd);
-        free(ifr);
-    }
-
-    close(fd);
-
-    count = ifc.ifc_len / sizeof(struct ifreq);
-    j = 0;
-    for (i = 0; i < count && j < max_count; i++) {
-        if (ifr[i].ifr_addr.sa_family != AF_INET) continue;
-
-        addr = (struct sockaddr_in *)&ifr[i].ifr_addr;
-        if (addr->sin_addr.s_addr == loopback) continue;
-
+
+    memset(&ifc, 0, sizeof(ifc));
+    ifc.ifc_ifcu.ifcu_req = NULL;
+    ifc.ifc_len = 0;
+
+    fd = socket(AF_INET, SOCK_DGRAM, 0);
+    if (fd < 0) return 0;
+
+    if (ioctl(fd, SIOCGIFCONF, &ifc) < 0) {
+        close(fd);
+        return 0;
+    }
+
+    ifr = malloc(ifc.ifc_len);
+    if (ifr == NULL) {
+        close(fd);
+        return 0;
+    }
+
+    ifc.ifc_ifcu.ifcu_req = ifr;
+    if (ioctl(fd, SIOCGIFCONF, &ifc) < 0) {
+        close(fd);
+        free(ifr);
+    }
+
+    close(fd);
+
+    count = ifc.ifc_len / sizeof(struct ifreq);
+    j = 0;
+    for (i = 0; i < count && j < max_count; i++) {
+        if (ifr[i].ifr_addr.sa_family != AF_INET) continue;
+
+        addr = (struct sockaddr_in *)&ifr[i].ifr_addr;
+        if (addr->sin_addr.s_addr == loopback) continue;
+
         if (local_virtual_ip == addr->sin_addr.s_addr)
         {
             Log(LOG_INFO, "get_local_address: ignore it!\n");
             continue;
         }
-        addrs[j++] = addr->sin_addr.s_addr;
-    }
-
-    free(ifr);
-    return j;
+        addrs[j++] = addr->sin_addr.s_addr;
+    }
+
+    free(ifr);
+    return j;
 }
 #endif
 
