communication+route: Do not advertise Adjacency LSAs when hyperbolic routing is enabled
refs: #2402
Change-Id: If204807733f858606e31a0ff8231f140905063cf
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index 343767a..e538153 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -49,9 +49,20 @@
if (pnlsr.getIsRoutingTableCalculating() == false) {
//setting routing table calculation
pnlsr.setIsRoutingTableCalculating(true);
- if (pnlsr.getLsdb().doesLsaExist(
- pnlsr.getConfParameter().getRouterPrefix().toUri() + "/" + "adjacency",
- std::string("adjacency"))) {
+
+ bool isHrEnabled = pnlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_OFF;
+
+ if ((!isHrEnabled
+ &&
+ pnlsr.getLsdb()
+ .doesLsaExist(pnlsr.getConfParameter().getRouterPrefix().toUri()
+ + "/" + "adjacency", std::string("adjacency")))
+ ||
+ (isHrEnabled
+ &&
+ pnlsr.getLsdb()
+ .doesLsaExist(pnlsr.getConfParameter().getRouterPrefix().toUri()
+ + "/" + "coordinate", std::string("coordinate")))) {
if (pnlsr.getIsBuildAdjLsaSheduled() != 1) {
_LOG_TRACE("Clearing old routing table");
clearRoutingTable();
@@ -127,7 +138,7 @@
RoutingTable::calculateHypRoutingTable(Nlsr& nlsr)
{
Map map;
- map.createFromAdjLsdb(nlsr);
+ map.createFromCoordinateLsdb(nlsr);
map.writeLog();
size_t nRouters = map.getMapSize();