--- a/src/netanim/model/animation-interface.cc Mon Oct 29 05:33:13 2012 -0700
+++ b/src/netanim/model/animation-interface.cc Wed Oct 31 23:17:27 2012 -0700
@@ -363,7 +363,12 @@
Ptr<Ipv4> ipv4 = NodeList::GetNode (nd->GetNode ()->GetId ())->GetObject <Ipv4> ();
if (!ipv4)
return "0.0.0.0";
- uint32_t ifIndex = ipv4->GetInterfaceForDevice (nd);
+ int32_t ifIndex = ipv4->GetInterfaceForDevice (nd);
+ if (ifIndex == -1)
+ {
+ NS_LOG_WARN ("Node :" << nd->GetNode ()->GetId () << " Could not find index of NetDevice");
+ return "0.0.0.0";
+ }
Ipv4InterfaceAddress addr = ipv4->GetAddress (ifIndex, 0);
std::ostringstream oss;
oss << addr.GetLocal ();