Better fix for bug 1643
authorTommaso Pecorella <tommaso.pecorella@unifi.it>
Mon, 20 May 2013 22:57:37 +0200
changeset 9762 070c5caed391
parent 9761 32e15e895529
child 9763 038d5627c5a9
child 9771 ddea5860c58c
Better fix for bug 1643
src/internet/model/icmpv6-l4-protocol.cc
--- a/src/internet/model/icmpv6-l4-protocol.cc	Fri May 17 13:46:25 2013 +0200
+++ b/src/internet/model/icmpv6-l4-protocol.cc	Mon May 20 22:57:37 2013 +0200
@@ -1234,10 +1234,20 @@
   if (cache)
     {
       NdiscCache::Entry* entry = cache->Lookup (dst);
-      if (entry && !(entry->IsIncomplete() || entry->IsProbe()))
+      if (entry)
         {
-          *hardwareDestination = entry->GetMacAddress ();
-          return true;
+          if (entry->IsReachable () || entry->IsDelay ())
+            {
+              *hardwareDestination = entry->GetMacAddress ();
+              return true;
+            }
+          else if (entry->IsStale ())
+            {
+              entry->StartDelayTimer ();
+              entry->MarkDelay ();
+              *hardwareDestination = entry->GetMacAddress ();
+              return true;
+            }
         }
     }
   return false;