diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-07-13 10:51:05 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-07-13 10:51:05 -0700 |
commit | 495c5ce81ddb245e21f21325927236d0f666f6cf (patch) | |
tree | 9314e377e7189cf8ccc52ed8b6ff5103a8a58f8f /node/Node.cpp | |
parent | dab0fb9e05677bdc6294f196fcf8234892c582c1 (diff) | |
download | infinitytier-495c5ce81ddb245e21f21325927236d0f666f6cf.tar.gz infinitytier-495c5ce81ddb245e21f21325927236d0f666f6cf.zip |
Bunch of remote tracing work.
Diffstat (limited to 'node/Node.cpp')
-rw-r--r-- | node/Node.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/node/Node.cpp b/node/Node.cpp index c54ca450..073af4bd 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -90,14 +90,15 @@ Node::Node(void *uptr,void *tptr,const struct ZT_Node_Callbacks *callbacks,uint6 } } - idtmp[0] = RR->identity.address().toInt(); idtmp[1] = 0; if (n <= 0) { RR->identity.generate(); + idtmp[0] = RR->identity.address().toInt(); idtmp[1] = 0; RR->identity.toString(false,RR->publicIdentityStr); RR->identity.toString(true,RR->secretIdentityStr); stateObjectPut(tptr,ZT_STATE_OBJECT_IDENTITY_SECRET,idtmp,RR->secretIdentityStr,(unsigned int)strlen(RR->secretIdentityStr)); stateObjectPut(tptr,ZT_STATE_OBJECT_IDENTITY_PUBLIC,idtmp,RR->publicIdentityStr,(unsigned int)strlen(RR->publicIdentityStr)); } else { + idtmp[0] = RR->identity.address().toInt(); idtmp[1] = 0; n = stateObjectGet(tptr,ZT_STATE_OBJECT_IDENTITY_PUBLIC,idtmp,tmp,sizeof(tmp) - 1); if (n > 0) { tmp[n] = (char)0; @@ -201,7 +202,7 @@ public: for(unsigned long k=0,ptr=(unsigned long)RR->node->prng();k<(unsigned long)upstreamStableEndpoints->size();++k) { const InetAddress &addr = (*upstreamStableEndpoints)[ptr++ % upstreamStableEndpoints->size()]; if (addr.ss_family == AF_INET) { - p->sendHELLO(_tPtr,InetAddress(),addr,_now,0); + p->sendHELLO(_tPtr,-1,addr,_now,0); contacted = true; break; } @@ -211,7 +212,7 @@ public: for(unsigned long k=0,ptr=(unsigned long)RR->node->prng();k<(unsigned long)upstreamStableEndpoints->size();++k) { const InetAddress &addr = (*upstreamStableEndpoints)[ptr++ % upstreamStableEndpoints->size()]; if (addr.ss_family == AF_INET6) { - p->sendHELLO(_tPtr,InetAddress(),addr,_now,0); + p->sendHELLO(_tPtr,-1,addr,_now,0); contacted = true; break; } |