Skip to content

Commit 26eb6ea

Browse files
committed
internet: fix ARP cache entries handling
1 parent 3c67095 commit 26eb6ea

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

src/internet/model/arp-cache.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,6 @@ class ArpCache : public Object
278278
*/
279279
void UpdateSeen();
280280

281-
<<<<<<< HEAD
282-
=======
283281
/**
284282
* @brief Print this ARP entry to the given output stream
285283
*
@@ -293,7 +291,6 @@ class ArpCache : public Object
293291
*/
294292
Time GetTimeout() const;
295293

296-
>>>>>>> 04b17e847 (internet: add functions to print an ArpCache::Entry)
297294
private:
298295
/**
299296
* @brief ARP cache entry states

src/internet/model/arp-l3-protocol.cc

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,23 @@ ArpL3Protocol::Lookup(Ptr<Packet> packet,
309309
cache,
310310
destination);
311311
}
312+
else if (entry->IsWaitReply())
313+
{
314+
NS_LOG_LOGIC("node=" << m_node->GetId() << ", entry for " << destination
315+
<< " waiting for a reply -- adding the packet to the queue");
316+
if (!entry->UpdateWaitReply(ArpCache::Ipv4PayloadHeaderPair(packet, ipHeader)))
317+
{
318+
// add the Ipv4 header for tracing purposes
319+
packet->AddHeader(ipHeader);
320+
m_dropTrace(packet);
321+
}
322+
return false;
323+
}
312324
else
313325
{
314-
NS_FATAL_ERROR("Test for possibly unreachable code-- please file a bug report, "
315-
"with a test case, if this is ever hit");
326+
NS_FATAL_ERROR("Test for possibly unreachable code -- please file a bug report, "
327+
"with a test case - "
328+
<< *entry);
316329
}
317330
}
318331
else
@@ -352,8 +365,9 @@ ArpL3Protocol::Lookup(Ptr<Packet> packet,
352365
}
353366
else
354367
{
355-
NS_LOG_LOGIC("Test for possibly unreachable code-- please file a bug report, with "
356-
"a test case, if this is ever hit");
368+
NS_FATAL_ERROR("Test for possibly unreachable code -- please file a bug report, "
369+
"with a test case - "
370+
<< *entry);
357371
}
358372
}
359373
}

0 commit comments

Comments
 (0)