Project

General

Profile

Actions

Bug #2322

closed

NamePrefixTable::removeEntry appends LSA components incorrectly

Added by Vince Lehman almost 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
12/23/2014
Due date:
% Done:

100%

Estimated time:

Description

Before a NamePrefixTable entry is removed, the LSDB is checked to make sure that the corresponding LSAs do not exist.

if (((*it).getRteListSize() == 0) &&
    (!m_nlsr.getLsdb().doesLsaExist(destRouter.append("/name"),
                                    std::string("name"))) &&
    (!m_nlsr.getLsdb().doesLsaExist(destRouter.append("/adjacency"),
                                    std::string("adjacency"))) &&
    (!m_nlsr.getLsdb().doesLsaExist(destRouter.append("/coordinate"),
                                    std::string("coordinate")))) {
  m_table.erase(it);
  m_nlsr.getFib().remove(name);
}

But, ndn::Name::append modifies the name that it is called with. So, the second check is actually checking:

$destRouter$/name/adjacency

Also, appending "/COMPONENT" is not the same as appending "COMPONENT".

BOOST_AUTO_TEST_CASE(ComponentTest)
{
  ndn::Name name1("Router");
  name1.append("/name");

  ndn::Name name2("Router");
  name2.append("name");

  BOOST_CHECK_EQUAL(name1, name2);
}

error in "ComponentTest": check name1 == name2 failed [/Router/%2Fname != /Router/name]

Thus, these checks will always return true as the names stored in the LSDB are different from the names that are checked.


Related issues 1 (0 open1 closed)

Related to NLSR - Task #2310: LSA string literals should be replaced with static variablesClosedMuktadir Chowdhury12/18/2014

Actions
Actions

Also available in: Atom PDF