Drop Hello freshness to 0 ms to avoid caching
Refs #5265
Change-Id: Ifea98ce19c90fedac2cb007b00ede6c8cd9d2773
diff --git a/.mailmap b/.mailmap
index 129698a..c36e401 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1,16 +1,18 @@
A K M Mahmudul Hoque <akmhoque@gmail.com>
+<aa@cs.fiu.edu> <alexander.afanasyev@ucla.edu>
<agawande@memphis.edu> <ashu2493@gmail.com>
-Nick Gordon <nmgordon@memphis.edu>
+Alexander Lane <awlane@memphis.edu>
+<davidepesa@gmail.com> <davide.pesavento@lip6.fr>
+<enewberry@email.arizona.edu> <enewberry@cs.arizona.edu>
Laqin Fan <lfan1@memphis.edu>
+Md Ashiqur Rahman <marahman@email.arizona.edu>
+Muktadir R Chowdhury <mrchwdhr@memphis.edu>
+Muktadir R Chowdhury <mrchwdhr@memphis.edu> <muktadir.rahman.c@gmail.com>
+Nick Gordon <nmgordon@memphis.edu>
+Saurab Dulal <sdulal@memphis.edu>
Syed Obaid Amin <soamin@memphis.edu>
Syed Obaid Amin <soamin@memphis.edu> <obaidasyed@gmail.com>
Syed Obaid Amin <soamin@memphis.edu> <obaid@Obaids-MacBook.local>
Syed Obaid Amin <soamin@memphis.edu> <obaid@obaids-macbook.memphis.edu>
Syed Obaid Amin <soamin@memphis.edu> <soamin@mira.cs.memphis.edu>
Syed Obaid Amin <soamin@memphis.edu> <soamin@wd222yx4.memphis.edu>
-Muktadir R Chowdhury <mrchwdhr@memphis.edu>
-Muktadir R Chowdhury <mrchwdhr@memphis.edu> <muktadir.rahman.c@gmail.com>
-<aa@cs.fiu.edu> <alexander.afanasyev@ucla.edu>
-<davidepesa@gmail.com> <davide.pesavento@lip6.fr>
-<enewberry@email.arizona.edu> <enewberry@cs.arizona.edu>
-Md Ashiqur Rahman <marahman@email.arizona.edu>
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index 49722fe..78f37b1 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-2023, The University of Memphis,
+ * Copyright (c) 2014-2024, The University of Memphis,
* Regents of the University of California
*
* This file is part of NLSR (Named-data Link State Routing).
@@ -124,20 +124,21 @@
return;
}
- ndn::Name neighbor;
- neighbor.wireDecode(interestName.get(-1).blockFromValue());
+ ndn::Name neighbor(interestName.get(-1).blockFromValue());
NLSR_LOG_DEBUG("Neighbor: " << neighbor);
if (m_adjacencyList.isNeighbor(neighbor)) {
auto data = std::make_shared<ndn::Data>();
data->setName(ndn::Name(interest.getName()).appendVersion());
- data->setFreshnessPeriod(10_s);
+ // A Hello reply being cached longer than is needed to fufill an Interest
+ // can cause counterintuitive behavior. Consequently, we use the default
+ // minimum of 0 ms.
+ data->setFreshnessPeriod(0_ms);
data->setContent(ndn::make_span(reinterpret_cast<const uint8_t*>(INFO_COMPONENT.data()),
INFO_COMPONENT.size()));
m_keyChain.sign(*data, m_signingInfo);
NLSR_LOG_DEBUG("Sending out data for name: " << interest.getName());
-
m_face.put(*data);
// increment SENT_HELLO_DATA
hpIncrementSignal(Statistics::PacketType::SENT_HELLO_DATA);
@@ -146,7 +147,7 @@
// If this neighbor was previously inactive, send our own hello interest, too
if (adjacent->getStatus() == Adjacent::STATUS_INACTIVE) {
// We can only do that if the neighbor currently has a face.
- if(adjacent->getFaceId() != 0){
+ if (adjacent->getFaceId() != 0) {
// interest name: /<neighbor>/NLSR/INFO/<router>
ndn::Name interestName(neighbor);
interestName.append(NLSR_COMPONENT);