From c9bfe640b7790d5546ef249e8de4559e51f3c52a Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Wed, 26 Sep 2018 06:52:57 -0400 Subject: [PATCH] increment sequence number so we don't spam new intro frames --- llarp/service/endpoint.cpp | 6 ++++++ llarp/service/protocol.cpp | 1 + 2 files changed, 7 insertions(+) diff --git a/llarp/service/endpoint.cpp b/llarp/service/endpoint.cpp index a81708330..e7fb0ea06 100644 --- a/llarp/service/endpoint.cpp +++ b/llarp/service/endpoint.cpp @@ -936,6 +936,8 @@ namespace llarp const byte_t* K = nullptr; for(const auto& tag : tags) { + if(tag.IsZero()) + continue; if(p == nullptr && GetIntroFor(tag, remoteIntro)) { if(!remoteIntro.ExpiresSoon(now)) @@ -1211,9 +1213,12 @@ namespace llarp llarp::LogWarn("no good path yet, your message may drop"); } } + ++sequenceNo; routing::PathTransferMessage transfer(msg, remoteIntro.pathID); if(path->SendRoutingMessage(&transfer, m_Endpoint->Router())) + { lastGoodSend = now; + } else llarp::LogError("Failed to send frame on path"); } @@ -1369,6 +1374,7 @@ namespace llarp m.introReply = path->intro; m.sender = m_Endpoint->m_Identity.pub; m.PutBuffer(payload); + m.tag = f.T; if(!f.EncryptAndSign(&crypto, m, shared, m_Endpoint->m_Identity)) { diff --git a/llarp/service/protocol.cpp b/llarp/service/protocol.cpp index 14b6b9e97..797fcdb0e 100644 --- a/llarp/service/protocol.cpp +++ b/llarp/service/protocol.cpp @@ -314,6 +314,7 @@ namespace llarp { if(T.IsZero()) { + llarp::LogInfo("Got protocol frame with new convo"); ProtocolMessage* msg = new ProtocolMessage(); msg->srcPath = srcPath; // we need to dh