src: Assign 0 cost to hyperbolic direct neighbors

refs: #1975

Change-Id: I4349a7935d1defca4772c0b4bf806a4dd12a8e50
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index e4e37fb..930dc33 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -143,6 +143,16 @@
 
   registerKeyPrefix();
   m_helloProtocol.scheduleInterest(10);
+
+  // Need to set direct neighbors' costs to 0 for hyperbolic routing
+  if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_ON) {
+
+    std::list<Adjacent>& neighbors = m_adjacencyList.getAdjList();
+
+    for (std::list<Adjacent>::iterator it = neighbors.begin(); it != neighbors.end(); ++it) {
+      it->setLinkCost(0);
+    }
+  }
 }
 
 void