diff --git a/src/internet/model/arp-cache.cc b/src/internet/model/arp-cache.cc index 9e9b9ae..d3cecaf 100644 --- a/src/internet/model/arp-cache.cc +++ b/src/internet/model/arp-cache.cc @@ -393,7 +393,7 @@ void ArpCache::Entry::MarkPermanent (void) { NS_LOG_FUNCTION (this); - NS_ASSERT (m_state == ALIVE); + NS_ASSERT (m_macAddress != 0); m_state = PERMANENT; ClearRetries (); UpdateSeen (); @@ -440,6 +440,12 @@ ArpCache::Entry::GetIpv4Address (void) const return m_ipv4Address; } void +ArpCache::Entry::SetMacAddresss (Address macAddress) +{ + NS_LOG_FUNCTION (this); + m_macAddress = macAddress; +} +void ArpCache::Entry::SetIpv4Address (Ipv4Address destination) { NS_LOG_FUNCTION (this << destination); diff --git a/src/internet/model/arp-cache.h b/src/internet/model/arp-cache.h index 2940b8f..1635706 100644 --- a/src/internet/model/arp-cache.h +++ b/src/internet/model/arp-cache.h @@ -225,6 +225,10 @@ public: */ Ipv4Address GetIpv4Address (void) const; /** + * \param macAddress The MacAddress for this entry + */ + void SetMacAddresss (Address macAddress); + /** * \param destination The Ipv4Address for this entry */ void SetIpv4Address (Ipv4Address destination); diff --git a/src/internet/model/arp-l3-protocol.cc b/src/internet/model/arp-l3-protocol.cc index f7b9d36..f075f9d 100644 --- a/src/internet/model/arp-l3-protocol.cc +++ b/src/internet/model/arp-l3-protocol.cc @@ -289,7 +289,7 @@ ArpL3Protocol::Lookup (Ptr packet, Ipv4Address destination, entry->MarkWaitReply (packet); Simulator::Schedule (Time (MilliSeconds (m_requestJitter->GetValue ())), &ArpL3Protocol::SendArpRequest, this, cache, destination); } - else if (entry->IsWaitReply ()) + else { NS_FATAL_ERROR ("Test for possibly unreachable code-- please file a bug report, with a test case, if this is ever hit"); } @@ -325,6 +325,10 @@ ArpL3Protocol::Lookup (Ptr packet, Ipv4Address destination, *hardwareDestination = entry->GetMacAddress (); return true; } + else + { + NS_LOG_LOGIC ("Test for possibly unreachable code-- please file a bug report, with a test case, if this is ever hit"); + } } } else