From a4a8086580b885950d3261055eb36a691c41ec06 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Thu, 15 May 2008 12:54:28 +0100 Subject: [PATCH 1/2] GlobalRoutingManager: don't abort with non-IP NetDevices, just skip them. --- .../global-routing/global-router-interface.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/routing/global-routing/global-router-interface.cc b/src/routing/global-routing/global-router-interface.cc index cda479043..5f8f8ccf2 100644 --- a/src/routing/global-routing/global-router-interface.cc +++ b/src/routing/global-routing/global-router-interface.cc @@ -533,6 +533,21 @@ GlobalRouter::DiscoverLSAs (void) { Ptr 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"); From 6547b9222c4b02c8f1fcd61a382dd2d725ee936e Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Thu, 15 May 2008 12:56:10 +0100 Subject: [PATCH 2/2] GlobalRoutingManager: don't segfault for NetDevices that have no associated Channel (e.g. virtual NetDevices); just skip them. --- src/routing/global-routing/global-router-interface.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/routing/global-routing/global-router-interface.cc b/src/routing/global-routing/global-router-interface.cc index 5f8f8ccf2..2816e5308 100644 --- a/src/routing/global-routing/global-router-interface.cc +++ b/src/routing/global-routing/global-router-interface.cc @@ -638,6 +638,10 @@ GlobalRouter::DiscoverLSAs (void) // router (to use OSPF lingo) is running. // Ptr ch = ndLocal->GetChannel(); + if (ch == NULL) + { + continue; + } Ptr ndRemote = GetAdjacent(ndLocal, ch); // // The adjacent net device is aggregated to a node. We need to ask that net