mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-12 02:34:59 +03:00
v4.15-9539-beta
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user