Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Cedar/Interop_OpenVPN.c')
-rw-r--r--src/Cedar/Interop_OpenVPN.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/Cedar/Interop_OpenVPN.c b/src/Cedar/Interop_OpenVPN.c
index 3d125b7f..6b7260a5 100644
--- a/src/Cedar/Interop_OpenVPN.c
+++ b/src/Cedar/Interop_OpenVPN.c
@@ -3,9 +3,9 @@
//
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
//
-// Copyright (c) 2012-2014 Daiyuu Nobori.
-// Copyright (c) 2012-2014 SoftEther VPN Project, University of Tsukuba, Japan.
-// Copyright (c) 2012-2014 SoftEther Corporation.
+// Copyright (c) 2012-2016 Daiyuu Nobori.
+// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
+// Copyright (c) 2012-2016 SoftEther Corporation.
//
// All Rights Reserved.
//
@@ -766,6 +766,7 @@ void OvsSetupSessionParameters(OPENVPN_SERVER *s, OPENVPN_SESSION *se, OPENVPN_C
{
LIST *o;
BUF *b;
+ char opt_str[MAX_SIZE];
// Validate arguments
if (s == NULL || se == NULL || c == NULL || data == NULL)
{
@@ -779,7 +780,14 @@ void OvsSetupSessionParameters(OPENVPN_SERVER *s, OPENVPN_SESSION *se, OPENVPN_C
OvsLog(s, se, c, "LO_OPTION_STR_RECV", data->OptionString);
- o = OvsParseOptions(data->OptionString);
+ Zero(opt_str, sizeof(opt_str));
+ StrCpy(opt_str, sizeof(opt_str), data->OptionString);
+ if (s->Cedar != NULL && (IsEmptyStr(opt_str) || StartWith(opt_str, "V0 UNDEF") || InStr(opt_str, ",") == false))
+ {
+ StrCpy(opt_str, sizeof(opt_str), s->Cedar->OpenVPNDefaultClientOption);
+ }
+
+ o = OvsParseOptions(opt_str);
if (se->Mode == OPENVPN_MODE_UNKNOWN)
{
@@ -2106,8 +2114,8 @@ void OvsRecvPacket(OPENVPN_SERVER *s, LIST *recv_packet_list, UINT protocol)
if (r->Exists)
{
Format(l3_options, sizeof(l3_options),
- ",route %r %r vpn_gateway",
- &r->Network, &r->SubnetMask);
+ ",route %r %r %r",
+ &r->Network, &r->SubnetMask, &r->Gateway);
StrCat(option_str, sizeof(option_str), l3_options);
}