internet: fix ARP cache entries handling

This commit is contained in:
Tommaso Pecorella
2025-04-05 17:39:51 +02:00
parent 3c67095225
commit 26eb6ea30d
2 changed files with 18 additions and 7 deletions

View File

@@ -278,8 +278,6 @@ class ArpCache : public Object
*/
void UpdateSeen();
<<<<<<< HEAD
=======
/**
* @brief Print this ARP entry to the given output stream
*
@@ -293,7 +291,6 @@ class ArpCache : public Object
*/
Time GetTimeout() const;
>>>>>>> 04b17e847 (internet: add functions to print an ArpCache::Entry)
private:
/**
* @brief ARP cache entry states

View File

@@ -309,10 +309,23 @@ ArpL3Protocol::Lookup(Ptr<Packet> packet,
cache,
destination);
}
else if (entry->IsWaitReply())
{
NS_LOG_LOGIC("node=" << m_node->GetId() << ", entry for " << destination
<< " waiting for a reply -- adding the packet to the queue");
if (!entry->UpdateWaitReply(ArpCache::Ipv4PayloadHeaderPair(packet, ipHeader)))
{
// add the Ipv4 header for tracing purposes
packet->AddHeader(ipHeader);
m_dropTrace(packet);
}
return false;
}
else
{
NS_FATAL_ERROR("Test for possibly unreachable code-- please file a bug report, "
"with a test case, if this is ever hit");
NS_FATAL_ERROR("Test for possibly unreachable code -- please file a bug report, "
"with a test case - "
<< *entry);
}
}
else
@@ -352,8 +365,9 @@ ArpL3Protocol::Lookup(Ptr<Packet> packet,
}
else
{
NS_LOG_LOGIC("Test for possibly unreachable code-- please file a bug report, with "
"a test case, if this is ever hit");
NS_FATAL_ERROR("Test for possibly unreachable code -- please file a bug report, "
"with a test case - "
<< *entry);
}
}
}