diff --git a/src/internet-stack/arp-l3-protocol.cc b/src/internet-stack/arp-l3-protocol.cc index f11d5e191..3e2bf7c26 100644 --- a/src/internet-stack/arp-l3-protocol.cc +++ b/src/internet-stack/arp-l3-protocol.cc @@ -315,21 +315,18 @@ ArpL3Protocol::SendArpRequest (Ptr cache, Ipv4Address to) ArpHeader arp; // need to pick a source address; use routing implementation to select Ptr ipv4 = m_node->GetObject (); - ipv4->GetInterfaceForDevice (cache->GetDevice ()); - NS_ASSERT (interface >= 0); + Ptr device = cache->GetDevice (); + NS_ASSERT (device != 0); Ipv4Header header; header.SetDestination (to); Ptr packet = Create (); - Ipv4Address source = ipv4->SelectSourceAddress (cache->GetDevice (), to, Ipv4InterfaceAddress::GLOBAL); + Ipv4Address source = ipv4->SelectSourceAddress (device, to, Ipv4InterfaceAddress::GLOBAL); NS_LOG_LOGIC ("ARP: sending request from node "<GetId ()<< - " || src: " << cache->GetDevice ()->GetAddress () << - " / " << source << - " || dst: " << cache->GetDevice ()->GetBroadcast () << - " / " << to); - arp.SetRequest (cache->GetDevice ()->GetAddress (), source, - cache->GetDevice ()->GetBroadcast (), to); + " || src: " << device->GetAddress () << " / " << source << + " || dst: " << device->GetBroadcast () << " / " << to); + arp.SetRequest (device->GetAddress (), source, device->GetBroadcast (), to); packet->AddHeader (arp); - cache->GetDevice ()->Send (packet, cache->GetDevice ()->GetBroadcast (), PROT_NUMBER); + cache->GetDevice ()->Send (packet, device->GetBroadcast (), PROT_NUMBER); } void