set base v6 address to nullopt when explicit empty string is provided

This commit is contained in:
Jeff Becker 2021-10-06 16:21:42 -04:00
parent 24681fd35d
commit 5e9f9686e7
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 6 additions and 0 deletions

View File

@ -569,7 +569,13 @@ namespace llarp
IP6RangeDefault,
[this](std::string arg) {
if (arg.empty())
{
LogError(
"!!! Disabling ipv6 tunneling when you have ipv6 routes WILL lead to "
"de-anonymization as lokinet will no longer carry your ipv6 traffic !!!");
m_baseV6Address = std::nullopt;
return;
}
m_baseV6Address = huint128_t{};
if (not m_baseV6Address->FromString(arg))
throw std::invalid_argument(