Squashed 'Sources/OpenVPN3/' changes from 1f92c424e1..407fc5fdb3

3e56f9a644 Finalizing OpenVPN 3 Core library release v3.5.6
a290b87d1a mssparms: do not fail on invalid mssfix values
59f201be90 Finalizing OpenVPN 3 Core library release v3.5.5
bbcf90171f Upgrade OpenSSL to 1.1.1g
a88f2379c3 win/tunutil.hpp: fix TAP adapter name query
abb7857452 Bump openssl version to 1.1.1f
89a3283944 Fix variable name typo in build-openssl
34435cbf65 Support optional HTTP Status Code reason
d5471e1846 Increase OpenSSL version to 1.1.1e
6daf928edb Merge branch 'hotfix/3.4' into released
40f1419b38 Merge branch 'hotfix/3.3' into hotfix/3.4
f225fcd058 Finalizing OpenVPN 3 release v3.3.4
44e8dd8c01 Fix build issues against OpenSSL 1.0.x
65a5e959bc Fix typo in OpenSSL error mapping
042502c932 Additional mappings for OpenSSL errors to OpenVPN error codes
c824c032b1 deps: Update to mbedtls-2.7.13
8b302a01c8 Finalizing OpenVPN 3 release v3.4.2
85bd50a577 Finalizing OpenVPN 3 release v3.3.3

git-subtree-dir: Sources/OpenVPN3
git-subtree-split: 407fc5fdb3bc73cf99dcd85a7fb3c1cbef833f0e
This commit is contained in:
Sergey Abramchuk
2020-08-18 13:48:40 +03:00
parent 86cc97e55f
commit f81b84d64d
9 changed files with 61 additions and 13 deletions
+26 -3
View File
@@ -33,18 +33,41 @@ namespace openvpn {
{
}
void parse(const OptionList& opt)
void parse(const OptionList& opt, bool nothrow=false)
{
const Option *o = opt.get_ptr("mssfix");
if (o)
{
const bool status = parse_number_validate<decltype(mssfix)>(o->get(1, 16),
const std::string* val = o->get_ptr(1, 16);
if (val == nullptr)
{
if (nothrow)
{
OPENVPN_LOG("Missing mssfix value, mssfix functionality disabled");
return;
}
else
throw option_error("mssfix must have a value");
}
const bool status = parse_number_validate<decltype(mssfix)>(*val,
16,
576,
65535,
&mssfix);
if (!status)
throw option_error("mssfix: parse/range issue");
{
if (nothrow)
{
// no need to warn if mssfix is actually 0
if (*val != "0")
{
OPENVPN_LOG("Invalid mssfix value " << *val << ", mssfix functionality disabled");
}
}
else
throw option_error("mssfix: parse/range issue");
}
mtu = (o->get_optional(2, 16) == "mtu");
}
}
+1 -1
View File
@@ -561,7 +561,7 @@ namespace openvpn {
tun_mtu = parse_tun_mtu(opt, tun_mtu);
// mssfix
mss_parms.parse(opt);
mss_parms.parse(opt, true);
// load parameters that can be present in both config file or pushed options
load_common(opt, pco, server ? LOAD_COMMON_SERVER : LOAD_COMMON_CLIENT);