Fix recurring sync prefix registration on every hello data
refs: #5157
Change-Id: Id0f77789976bd84720d2f96b549013b285e58978
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index 9585255..e11f0e4 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, The University of Memphis,
+ * Copyright (c) 2014-2021, The University of Memphis,
* Regents of the University of California
*
* This file is part of NLSR (Named-data Link State Routing).
@@ -246,9 +246,8 @@
else {
m_lsdb.scheduleAdjLsaBuild();
}
+ onInitialHelloDataValidated(neighbor);
}
-
- onHelloDataValidated(neighbor);
}
// increment RCV_HELLO_DATA
hpIncrementSignal(Statistics::PacketType::RCV_HELLO_DATA);
diff --git a/src/hello-protocol.hpp b/src/hello-protocol.hpp
index 9ff5924..a42a4de 100644
--- a/src/hello-protocol.hpp
+++ b/src/hello-protocol.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, The University of Memphis,
+ * Copyright (c) 2014-2021, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
@@ -126,7 +126,7 @@
const ndn::security::ValidationError& ve);
public:
- ndn::util::Signal<HelloProtocol, const ndn::Name&> onHelloDataValidated;
+ ndn::util::Signal<HelloProtocol, const ndn::Name&> onInitialHelloDataValidated;
private:
ndn::Face& m_face;
@@ -138,6 +138,7 @@
Lsdb& m_lsdb;
AdjacencyList& m_adjacencyList;
+PUBLIC_WITH_TESTS_ELSE_PRIVATE:
static const std::string INFO_COMPONENT;
static const std::string NLSR_COMPONENT;
};
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index cb24559..abf5c5f 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -56,7 +56,7 @@
[this] (const ndn::Name& name) {
m_helloProtocol.sendHelloInterest(name);
}))
- , m_onHelloDataValidated(m_helloProtocol.onHelloDataValidated.connect(
+ , m_onInitialHelloDataValidated(m_helloProtocol.onInitialHelloDataValidated.connect(
[this] (const ndn::Name& neighbor) {
auto it = m_adjacencyList.findAdjacent(neighbor);
if (it != m_adjacencyList.end()) {
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index 3e22874..4c97401 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.hpp
@@ -179,7 +179,7 @@
private:
ndn::util::signal::ScopedConnection m_onNewLsaConnection;
ndn::util::signal::ScopedConnection m_onPrefixRegistrationSuccess;
- ndn::util::signal::ScopedConnection m_onHelloDataValidated;
+ ndn::util::signal::ScopedConnection m_onInitialHelloDataValidated;
PUBLIC_WITH_TESTS_ELSE_PRIVATE:
ndn::mgmt::Dispatcher m_dispatcher;