merge with HEAD
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 16 May 2008 08:41:19 -0700
changeset 3024 30ca8e7b5e89
parent 3023 e690b0d1b625 (current diff)
parent 3020 953e6fc56bf0 (diff)
child 3025 d93423ef5ef2
merge with HEAD
--- a/src/routing/global-routing/global-router-interface.cc	Thu May 15 07:47:17 2008 -0400
+++ b/src/routing/global-routing/global-router-interface.cc	Fri May 16 08:41:19 2008 -0700
@@ -533,6 +533,21 @@
     {
       Ptr<NetDevice> ndLocal = node->GetDevice(i);
 
+      // Check if it is an IP interface (could be a pure L2 NetDevice)
+      bool isIp = false;
+      for (uint32_t i = 0; i < ipv4Local->GetNInterfaces (); ++i )
+        {
+          if (ipv4Local->GetNetDevice (i) == ndLocal) 
+            {
+              isIp = true;
+              break;
+            }
+        }
+      if (!isIp)
+        {
+          continue;
+        }
+
       if (ndLocal->IsBroadcast () && !ndLocal->IsPointToPoint () )
         {
           NS_LOG_LOGIC ("Broadcast link");
@@ -623,6 +638,10 @@
 // router (to use OSPF lingo) is running.  
 //
           Ptr<Channel> ch = ndLocal->GetChannel();
+          if (ch == NULL)
+            {
+              continue;
+            }
           Ptr<NetDevice> ndRemote = GetAdjacent(ndLocal, ch);
 //
 // The adjacent net device is aggregated to a node.  We need to ask that net