1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-07 00:04:57 +03:00

v4.06-9435-beta

This commit is contained in:
dnobori
2014-03-26 12:38:30 +09:00
parent e61fca4d9d
commit 16d73ccb57
285 changed files with 425 additions and 280 deletions

View File

@ -123,7 +123,7 @@
#define CEDAR_VER 406
// Build Number
#define CEDAR_BUILD 9433
#define CEDAR_BUILD 9435
// Beta number
//#define BETA_NUMBER 3
@ -144,10 +144,10 @@
// Specifies the build date
#define BUILD_DATE_Y 2014
#define BUILD_DATE_M 3
#define BUILD_DATE_D 21
#define BUILD_DATE_HO 13
#define BUILD_DATE_MI 16
#define BUILD_DATE_SE 55
#define BUILD_DATE_D 26
#define BUILD_DATE_HO 10
#define BUILD_DATE_MI 52
#define BUILD_DATE_SE 19
// Tolerable time difference
#define ALLOW_TIMESTAMP_DIFF (UINT64)(3 * 24 * 60 * 60 * 1000)

View File

@ -1866,7 +1866,7 @@ void CnStart()
BEGIN_LISTENER:
Lock(cn_listener_lock);
cn_listener = o = NewListenerEx(cedar, LISTENER_TCP, CLIENT_NOTIFY_PORT, CnListenerProc, NULL);
cn_listener = o = NewListenerEx2(cedar, LISTENER_TCP, CLIENT_NOTIFY_PORT, CnListenerProc, NULL, true);
Unlock(cn_listener_lock);
while (true)
@ -5509,6 +5509,11 @@ void CiRpcServerThread(THREAD *thread, void *param)
return;
}
#ifdef OS_WIN32
MsRegWriteIntEx2(REG_LOCAL_MACHINE, CLIENT_WIN32_REGKEYNAME, CLIENT_WIN32_REGVALUE_PORT, i, false, true);
MsRegWriteIntEx2(REG_LOCAL_MACHINE, CLIENT_WIN32_REGKEYNAME, CLIENT_WIN32_REGVALUE_PID, MsGetCurrentProcessId(), false, true);
#endif // OS_WIN32
c->RpcListener = listener;
AddRef(listener->ref);
@ -5576,6 +5581,11 @@ void CiRpcServerThread(THREAD *thread, void *param)
ReleaseList(c->RpcConnectionList);
ReleaseList(thread_list);
#ifdef OS_WIN32
MsRegDeleteValueEx2(REG_LOCAL_MACHINE, CLIENT_WIN32_REGKEYNAME, CLIENT_WIN32_REGVALUE_PORT, false, true);
MsRegDeleteValueEx2(REG_LOCAL_MACHINE, CLIENT_WIN32_REGKEYNAME, CLIENT_WIN32_REGVALUE_PID, false, true);
#endif // OS_WIN32
}
// Start the Keep
@ -5783,7 +5793,7 @@ REMOTE_CLIENT *CcConnectRpc(char *server_name, char *password, bool *bad_pass, b
}
REMOTE_CLIENT *CcConnectRpcEx(char *server_name, char *password, bool *bad_pass, bool *no_remote, UCHAR *key, UINT *key_error_code, bool shortcut_disconnect, UINT wait_retry)
{
SOCK *s;
SOCK *s = NULL;
UINT i;
UINT retcode;
UINT rpc_mode = CLIENT_RPC_MODE_MANAGEMENT;
@ -5793,6 +5803,8 @@ REMOTE_CLIENT *CcConnectRpcEx(char *server_name, char *password, bool *bad_pass,
UINT port_start;
UINT64 try_started = 0;
bool ok;
UINT reg_port = 0;
UINT reg_pid = 0;
// Validate arguments
if (server_name == NULL)
{
@ -5818,8 +5830,41 @@ REMOTE_CLIENT *CcConnectRpcEx(char *server_name, char *password, bool *bad_pass,
*no_remote = false;
}
#ifdef OS_WIN32
// read the current port number from the registry of the localhost
if (StrCmpi(server_name, "localhost") == 0)
{
wchar_t exename[MAX_PATH];
reg_port = MsRegReadIntEx2(REG_LOCAL_MACHINE, CLIENT_WIN32_REGKEYNAME, CLIENT_WIN32_REGVALUE_PORT, false, true);
reg_pid = MsRegReadIntEx2(REG_LOCAL_MACHINE, CLIENT_WIN32_REGKEYNAME, CLIENT_WIN32_REGVALUE_PID, false, true);
if (reg_pid != 0)
{
if (MsIsServiceRunning(GC_SVC_NAME_VPNCLIENT) == false)
{
reg_port = 0;
}
}
else
{
reg_port = 0;
}
}
#endif // OS_WIN32
port_start = CLIENT_CONFIG_PORT - 1;
if (reg_port != 0)
{
s = Connect(server_name, reg_port);
if (s != NULL)
{
goto L_TRY;
}
}
RETRY:
port_start++;
@ -5882,6 +5927,9 @@ RETRY:
}
goto RETRY;
}
L_TRY:
SetTimeout(s, 10000);
Hash(hash_password, password, StrLen(password), true);
@ -5925,6 +5973,7 @@ RETRY:
if (retcode >= 1024)
{
ReleaseSock(s);
goto RETRY;
}
@ -5961,6 +6010,8 @@ RETRY:
return NULL;
}
SetTimeout(s, INFINITE);
rpc = StartRpcClient(s, NULL);
ReleaseSock(s);

View File

@ -134,6 +134,10 @@
#define CLIENT_GLOBAL_PULSE_NAME "clientglobalpulse"
#define CLIENT_WIN32_REGKEYNAME "Software\\" GC_REG_COMPANY_NAME "\\" CEDAR_PRODUCT_STR " VPN\\Client"
#define CLIENT_WIN32_REGVALUE_PORT "RpcPort"
#define CLIENT_WIN32_REGVALUE_PID "RpcPid"
// List of virtual LAN cards in UNIX
struct UNIX_VLAN

View File

@ -2371,6 +2371,44 @@ LABEL_RETRY_4:
FileDeleteW(setuplog);
}
// Delete the existing Virtual Network Adapters
// Currently disabled because of 32bit/64bit problems
#if 0
if (c->Id == SW_CMP_VPN_CLIENT)
{
if (MsIsNt())
{
if (!(MsIs64BitWindows() && Is32()))
{
UINT i;
TOKEN_LIST *t;
SwPerformPrint(wp, _UU("SW_PERFORM_MSG_DELETE_NIC"));
// Enumeration
t = MsEnumNetworkAdapters(VLAN_ADAPTER_NAME, VLAN_ADAPTER_NAME_OLD);
if (t != NULL)
{
if (t->NumTokens >= 1)
{
if (SwPerformMsgBox(wp, MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2, _UU("SW_PERFORM_MSG_DELETE_NIC")) == IDYES)
{
for (i = 0;i < t->NumTokens;i++)
{
char *name = t->Token[i];
MsUninstallVLan(name);
}
}
}
FreeToken(t);
}
}
}
}
#endif
SwPerformPrint(wp, _UU("SW_PERFORM_MSG_UPDATING"));
// Notify the update to the system