Project

General

Profile

Actions

Bug #2322

closed

NamePrefixTable::removeEntry appends LSA components incorrectly

Added by Vince Lehman over 9 years ago. Updated almost 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 #1

Updated by Vince Lehman over 9 years ago

  • Tracker changed from Task to Bug
Actions #2

Updated by Vince Lehman over 9 years ago

  • Related to Task #2310: LSA string literals should be replaced with static variables added
Actions #3

Updated by Vince Lehman over 9 years ago

  • Subject changed from NamePrefixTable::removeEntry appends incorrect LSA components to NamePrefixTable::removeEntry appends LSA components incorrectly
  • Description updated (diff)
Actions #4

Updated by Lan Wang about 9 years ago

  • Assignee set to Vince Lehman
Actions #5

Updated by Vince Lehman almost 9 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF