diff options
author | dnobori <da.git@softether.co.jp> | 2015-04-03 23:58:09 +0300 |
---|---|---|
committer | dnobori <da.git@softether.co.jp> | 2015-04-03 23:58:09 +0300 |
commit | 983c19c043ae80ac528c3efb19668c0049817fec (patch) | |
tree | 7650d511ffd102d37954e7ae855e0b94f54138e1 /src/Cedar/Session.c | |
parent | 18b120e5f747a84d26302ec706f6c1c91d642ace (diff) |
v4.15-9539-beta
Diffstat (limited to 'src/Cedar/Session.c')
-rw-r--r-- | src/Cedar/Session.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/Cedar/Session.c b/src/Cedar/Session.c index 601a635f..6669ade3 100644 --- a/src/Cedar/Session.c +++ b/src/Cedar/Session.c @@ -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
|