NetAnim: Handle special case for deferred routes
authorJohn Abraham <john.abraham.in@gmail.com>
Thu, 28 Feb 2013 14:48:50 -0800
changeset 9248 31e5a4b0f1b2
parent 9247 740c45821021
child 9249 93d61b00eb6f
NetAnim: Handle special case for deferred routes
src/netanim/model/animation-interface.cc
--- a/src/netanim/model/animation-interface.cc	Thu Feb 28 08:51:25 2013 -0800
+++ b/src/netanim/model/animation-interface.cc	Thu Feb 28 14:48:50 2013 -0800
@@ -118,9 +118,9 @@
 void AnimationInterface::RecursiveIpv4RoutePathSearch (std::string from, std::string to, Ipv4RoutePathElements & rpElements)
 {
   NS_LOG_INFO ("RecursiveIpv4RoutePathSearch from:" << from.c_str () << " to:" << to.c_str ());
-  if (from == "0.0.0.0")
+  if ((from == "0.0.0.0") || (from == "127.0.0.1"))
     {
-      NS_LOG_INFO ("Got 0.0.0.0, End recursion");
+      NS_LOG_INFO ("Got " << from.c_str () << " End recursion");
       return;
     }
   Ptr <Node> fromNode = NodeList::GetNode (m_ipv4ToNodeIdMap[from]);
@@ -237,6 +237,11 @@
               rpElements.push_back (elem2);
             }
         }
+      else if (rt->GetGateway () == "127.0.0.1")
+        {
+          Ipv4RoutePathElement elem = { trackElement.fromNodeId, "-1" };
+          rpElements.push_back (elem);
+        }
       else
         {
           Ipv4RoutePathElement elem = { trackElement.fromNodeId, oss.str () };