src/routing/static-routing/ipv6-static-routing.cc
changeset 4766 0a74df84902f
parent 4761 8c0b3a413f4b
child 5352 54b51a1105d6
--- a/src/routing/static-routing/ipv6-static-routing.cc	Tue Sep 08 06:37:37 2009 +0200
+++ b/src/routing/static-routing/ipv6-static-routing.cc	Tue Sep 08 07:07:58 2009 +0200
@@ -274,7 +274,6 @@
         uint32_t interfaceIdx = route->GetInterface ();
         rtentry = Create<Ipv6Route> ();
 
-
         if (route->GetGateway ().IsAny ())
         {
           rtentry->SetSource (SourceAddressSelection (interfaceIdx, route->GetDest ()));
@@ -295,7 +294,10 @@
     }
   }
 
-  NS_LOG_LOGIC ("Matching route via " << rtentry->GetDestination () << " (throught " << rtentry->GetGateway () << ") at the end");
+  if(rtentry)
+  {
+    NS_LOG_LOGIC ("Matching route via " << rtentry->GetDestination () << " (throught " << rtentry->GetGateway () << ") at the end");
+  }
   return rtentry;
 }
 
@@ -653,6 +655,11 @@
     /* this case is mainly used by configuring default route following RA processing,
      * in case of multipe prefix in RA, the first will configured default route
      */
+
+    /* for the moment, all default route has the same metric
+     * so according to the longest prefix algorithm,
+     * the default route choosen will be the last added
+     */
     SetDefaultRoute (nextHop, interface, prefixToUse);
   }
 }