route: Fixing segfault issue for Hyperbolic Routing Table Calculation

Refs: #1815

Change-Id: I317259d299e4117f0846ed98c432b39d1404b643
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index 613371f..7ab5b8e 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -73,7 +73,7 @@
         //need to update NPT here
         _LOG_DEBUG("Calling Update NPT With new Route");
         pnlsr.getNamePrefixTable().updateWithNewRoute();
-        writeLog();
+        writeLog(pnlsr.getConfParameter().getHyperbolicState());
         pnlsr.getNamePrefixTable().writeLog();
         pnlsr.getFib().writeLog();
       }
@@ -90,7 +90,7 @@
       // need to update NPT here
       _LOG_DEBUG("Calling Update NPT With new Route");
       pnlsr.getNamePrefixTable().updateWithNewRoute();
-      writeLog();
+      writeLog(pnlsr.getConfParameter().getHyperbolicState());
       pnlsr.getNamePrefixTable().writeLog();
       pnlsr.getFib().writeLog();
       //debugging purpose end
@@ -184,7 +184,7 @@
 }
 
 void
-RoutingTable::writeLog()
+RoutingTable::writeLog(int hyperbolicState)
 {
   _LOG_DEBUG("---------------Routing Table------------------");
   for (std::list<RoutingTableEntry>::iterator it = m_rTable.begin() ;
@@ -193,6 +193,16 @@
     _LOG_DEBUG("Nexthops: ");
     (*it).getNexthopList().writeLog();
   }
+
+  if (hyperbolicState == HYPERBOLIC_STATE_DRY_RUN) {
+    _LOG_DEBUG("--------Hyperbolic Routing Table(Dry)---------");
+    for (std::list<RoutingTableEntry>::iterator it = m_dryTable.begin() ;
+        it != m_dryTable.end(); ++it) {
+      _LOG_DEBUG("Destination: " << (*it).getDestination());
+      _LOG_DEBUG("Nexthops: ");
+      (*it).getNexthopList().writeLog();
+    }
+  }
 }
 
 //function related to manipulation of dry routing table