summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rw-r--r--service/OneService.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/service/OneService.cpp b/service/OneService.cpp
index 289f0cbc..efb6ff3c 100644
--- a/service/OneService.cpp
+++ b/service/OneService.cpp
@@ -883,7 +883,7 @@ public:
json &virt = _localConfig["virtual"];
if (virt.is_object()) {
for(json::iterator v(virt.begin());v!=virt.end();++v) {
- std::string nstr = v.key();
+ const std::string nstr = v.key();
if ((nstr.length() == ZT_ADDRESS_LENGTH_HEX)&&(v.value().is_object())) {
const Address ztaddr(nstr.c_str());
if (ztaddr)
@@ -891,6 +891,17 @@ public:
}
}
}
+
+ // Set any other local config stuff
+ json &settings = _localConfig["settings"];
+ if (settings.is_object()) {
+ const std::string rp(_jS(settings["relayPolicy"],""));
+ if (rp == "always")
+ _node->setRelayPolicy(ZT_RELAY_POLICY_ALWAYS);
+ else if (rp == "never")
+ _node->setRelayPolicy(ZT_RELAY_POLICY_NEVER);
+ else _node->setRelayPolicy(ZT_RELAY_POLICY_TRUSTED);
+ }
}
_controller = new EmbeddedNetworkController(_node,(_homePath + ZT_PATH_SEPARATOR_S + ZT_CONTROLLER_DB_PATH).c_str());