mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-07 00:04:57 +03:00
v4.15-9539-beta
This commit is contained in:
@ -138,7 +138,7 @@
|
||||
#define CEDAR_VER 415
|
||||
|
||||
// Build Number
|
||||
#define CEDAR_BUILD 9538
|
||||
#define CEDAR_BUILD 9539
|
||||
|
||||
// Beta number
|
||||
//#define BETA_NUMBER 3
|
||||
@ -158,11 +158,11 @@
|
||||
|
||||
// Specifies the build date
|
||||
#define BUILD_DATE_Y 2015
|
||||
#define BUILD_DATE_M 3
|
||||
#define BUILD_DATE_D 27
|
||||
#define BUILD_DATE_HO 19
|
||||
#define BUILD_DATE_MI 32
|
||||
#define BUILD_DATE_SE 50
|
||||
#define BUILD_DATE_M 4
|
||||
#define BUILD_DATE_D 4
|
||||
#define BUILD_DATE_HO 0
|
||||
#define BUILD_DATE_MI 11
|
||||
#define BUILD_DATE_SE 55
|
||||
|
||||
// Tolerable time difference
|
||||
#define ALLOW_TIMESTAMP_DIFF (UINT64)(3 * 24 * 60 * 60 * 1000)
|
||||
@ -941,6 +941,7 @@
|
||||
#define ERR_VPNGATE_CLIENT 145 // Operation on VPN Gate Client is not available
|
||||
#define ERR_VPNGATE_INCLIENT_CANT_STOP 146 // Can not be stopped if operating within VPN Client mode
|
||||
#define ERR_NOT_SUPPORTED_FUNCTION_ON_OPENSOURCE 147 // It is a feature that is not supported in the open source version
|
||||
#define ERR_SUSPENDING 148 // System is suspending
|
||||
|
||||
|
||||
////////////////////////////
|
||||
|
@ -10590,6 +10590,13 @@ CLIENT *CiNewClient()
|
||||
ci_num_active_sessions = 0;
|
||||
}
|
||||
|
||||
#ifdef OS_WIN32
|
||||
if (MsIsWindows7())
|
||||
{
|
||||
c->MsSuspendHandler = MsNewSuspendHandler();
|
||||
}
|
||||
#endif // OS_WIN32
|
||||
|
||||
|
||||
c->CmSetting = ZeroMalloc(sizeof(CM_SETTING));
|
||||
|
||||
@ -10811,6 +10818,13 @@ void CiCleanupClient(CLIENT *c)
|
||||
Free(c->CmSetting);
|
||||
|
||||
|
||||
#ifdef OS_WIN32
|
||||
if (c->MsSuspendHandler != NULL)
|
||||
{
|
||||
MsFreeSuspendHandler(c->MsSuspendHandler);
|
||||
}
|
||||
#endif // OS_WIN32
|
||||
|
||||
Free(c);
|
||||
|
||||
#ifdef OS_WIN32
|
||||
|
@ -503,6 +503,7 @@ struct CLIENT
|
||||
bool NoSaveLog; // Do not save the log
|
||||
bool NoSaveConfig; // Do not save the settings
|
||||
INTERNET_SETTING CommonProxySetting; // Common proxy settings
|
||||
void *MsSuspendHandler; // MS suspend handler
|
||||
|
||||
};
|
||||
|
||||
|
@ -144,6 +144,7 @@ void SessionMain(SESSION *s)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Debug("SessionMain: %s\n", s->Name);
|
||||
|
||||
Notify(s, CLIENT_NOTIFY_ACCOUNT_CHANGED);
|
||||
@ -161,6 +162,19 @@ void SessionMain(SESSION *s)
|
||||
policy = s->Policy;
|
||||
|
||||
// Initialize the packet adapter
|
||||
#ifdef OS_WIN32
|
||||
if (s->IsVPNClientAndVLAN_Win32)
|
||||
{
|
||||
MsBeginVLanCard();
|
||||
|
||||
if (MsIsVLanCardShouldStop())
|
||||
{
|
||||
err = ERR_SUSPENDING;
|
||||
goto CLEANUP;
|
||||
}
|
||||
}
|
||||
#endif // OS_WIN32
|
||||
|
||||
pa = s->PacketAdapter;
|
||||
if (pa->Init(s) == false)
|
||||
{
|
||||
@ -358,6 +372,18 @@ void SessionMain(SESSION *s)
|
||||
pa_fail = true;
|
||||
}
|
||||
|
||||
#ifdef OS_WIN32
|
||||
if (s->IsVPNClientAndVLAN_Win32)
|
||||
{
|
||||
if (MsIsVLanCardShouldStop())
|
||||
{
|
||||
// System is suspending
|
||||
err = ERR_SUSPENDING;
|
||||
pa_fail = true;
|
||||
}
|
||||
}
|
||||
#endif // OS_WIN32
|
||||
|
||||
// Pass the received block to the PacketAdapter
|
||||
if (lock_receive_blocks_queue)
|
||||
{
|
||||
@ -707,6 +733,13 @@ CLEANUP:
|
||||
pa->Free(s);
|
||||
}
|
||||
|
||||
#ifdef OS_WIN32
|
||||
if (s->IsVPNClientAndVLAN_Win32)
|
||||
{
|
||||
MsEndVLanCard();
|
||||
}
|
||||
#endif // OS_WIN32
|
||||
|
||||
if (s->ServerMode == false)
|
||||
{
|
||||
// Cancel to make all additional connection
|
||||
@ -1972,11 +2005,17 @@ SESSION *NewClientSessionEx(CEDAR *cedar, CLIENT_OPTION *option, CLIENT_AUTH *au
|
||||
|
||||
// Hold whether the virtual LAN card is used in client mode
|
||||
s->ClientModeAndUseVLan = (StrLen(s->ClientOption->DeviceName) == 0) ? false : true;
|
||||
|
||||
if (s->ClientOption->NoRoutingTracking)
|
||||
{
|
||||
s->ClientModeAndUseVLan = false;
|
||||
}
|
||||
|
||||
if (pa->Id == PACKET_ADAPTER_ID_VLAN_WIN32)
|
||||
{
|
||||
s->IsVPNClientAndVLAN_Win32 = true;
|
||||
}
|
||||
|
||||
if (StrLen(option->DeviceName) == 0)
|
||||
{
|
||||
// NAT mode
|
||||
|
@ -167,8 +167,13 @@ struct PACKET_ADAPTER
|
||||
PA_PUTPACKET *PutPacket;
|
||||
PA_FREE *Free;
|
||||
void *Param;
|
||||
UINT Id;
|
||||
};
|
||||
|
||||
// Packet Adapter IDs
|
||||
#define PACKET_ADAPTER_ID_VLAN_WIN32 1
|
||||
|
||||
|
||||
// Session structure
|
||||
struct SESSION
|
||||
{
|
||||
@ -262,6 +267,7 @@ struct SESSION
|
||||
UINT64 CurrentConnectionEstablishTime; // Completion time of this connection
|
||||
UINT NumConnectionsEatablished; // Number of connections established so far
|
||||
UINT AdjustMss; // MSS adjustment value
|
||||
bool IsVPNClientAndVLAN_Win32; // Is the VPN Client session with a VLAN card (Win32)
|
||||
|
||||
bool IsRUDPSession; // Whether R-UDP session
|
||||
UINT RUdpMss; // The value of the MSS should be applied while the R-UDP is used
|
||||
|
@ -1269,6 +1269,8 @@ PACKET_ADAPTER *VLanGetPacketAdapter()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pa->Id = PACKET_ADAPTER_ID_VLAN_WIN32;
|
||||
|
||||
return pa;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user