summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-10-25 13:04:42 -0400
committerroot <root@cthulhu.zerotier.com>2013-10-25 13:04:58 -0400
commit1505e8dd504711f38e5d975022c3c5366e87791a (patch)
treef4b35079263f9cd113e70b34d2af3949400f2e1f /node
parent5901972958d6ef50671b7bbb89d2b365e4baf17c (diff)
downloadinfinitytier-1505e8dd504711f38e5d975022c3c5366e87791a.tar.gz
infinitytier-1505e8dd504711f38e5d975022c3c5366e87791a.zip
Fix netconf init and identity transfer.
Diffstat (limited to 'node')
-rw-r--r--node/Node.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/node/Node.cpp b/node/Node.cpp
index 815451fd..fe8cfb18 100644
--- a/node/Node.cpp
+++ b/node/Node.cpp
@@ -235,7 +235,13 @@ static void _netconfServiceMessageHandler(void *renv,Service &svc,const Dictiona
try {
//TRACE("from netconf:\n%s",msg.toString().c_str());
const std::string &type = msg.get("type");
- if (type == "netconf-response") {
+ if (type == "ready") {
+ LOG("received 'ready' from netconf.service, sending netconf-init with identity information...");
+ Dictionary initMessage;
+ initMessage["type"] = "netconf-init";
+ initMessage["netconfId"] = _r->identity.toString(true);
+ _r->netconfService->send(initMessage);
+ } else if (type == "netconf-response") {
uint64_t inRePacketId = strtoull(msg.get("requestId").c_str(),(char **)0,16);
uint64_t nwid = strtoull(msg.get("nwid").c_str(),(char **)0,16);
Address peerAddress(msg.get("peer").c_str());
@@ -442,7 +448,7 @@ Node::ReasonForTermination Node::run()
try {
std::string netconfServicePath(_r->homePath + ZT_PATH_SEPARATOR_S + "services.d" + ZT_PATH_SEPARATOR_S + "netconf.service");
if (Utils::fileExists(netconfServicePath.c_str())) {
- LOG("netconf.d/netconfi.service appears to exist, starting...");
+ LOG("netconf.d/netconf.service appears to exist, starting...");
_r->netconfService = new Service(_r,"netconf",netconfServicePath.c_str(),&_netconfServiceMessageHandler,_r);
Dictionary initMessage;
initMessage["type"] = "netconf-init";