src/internet-stack/ipv4-l3-protocol.cc
changeset 6182 9e060dd421fa
parent 6181 05727a89b220
child 6232 cdf770714461
equal deleted inserted replaced
6181:05727a89b220 6182:9e060dd421fa
   592     {
   592     {
   593       NS_LOG_LOGIC ("Ipv4L3Protocol::Send case 3:  passed in with route");
   593       NS_LOG_LOGIC ("Ipv4L3Protocol::Send case 3:  passed in with route");
   594       ipHeader = BuildHeader (source, destination, protocol, packet->GetSize (), ttl, mayFragment);
   594       ipHeader = BuildHeader (source, destination, protocol, packet->GetSize (), ttl, mayFragment);
   595       int32_t interface = GetInterfaceForDevice (route->GetOutputDevice ());
   595       int32_t interface = GetInterfaceForDevice (route->GetOutputDevice ());
   596       m_sendOutgoingTrace (ipHeader, packet, interface);
   596       m_sendOutgoingTrace (ipHeader, packet, interface);
   597       SendRealOut (route, packet, ipHeader);
   597       SendRealOut (route, packet->Copy (), ipHeader);
   598       return; 
   598       return; 
   599     } 
   599     } 
   600   // 4) packet is not broadcast, and is passed in with a route entry but route->GetGateway is not set (e.g., on-demand)
   600   // 4) packet is not broadcast, and is passed in with a route entry but route->GetGateway is not set (e.g., on-demand)
   601   if (route && route->GetGateway () != Ipv4Address ())
   601   if (route && route->GetGateway () != Ipv4Address ())
   602     {
   602     {
   622     }
   622     }
   623   if (newRoute)
   623   if (newRoute)
   624     {
   624     {
   625       int32_t interface = GetInterfaceForDevice (newRoute->GetOutputDevice ());
   625       int32_t interface = GetInterfaceForDevice (newRoute->GetOutputDevice ());
   626       m_sendOutgoingTrace (ipHeader, packet, interface);
   626       m_sendOutgoingTrace (ipHeader, packet, interface);
   627       SendRealOut (newRoute, packet, ipHeader);
   627       SendRealOut (newRoute, packet->Copy (), ipHeader);
   628     }
   628     }
   629   else
   629   else
   630     {
   630     {
   631       NS_LOG_WARN ("No route to host.  Drop.");
   631       NS_LOG_WARN ("No route to host.  Drop.");
   632       m_dropTrace (ipHeader, packet, DROP_NO_ROUTE, m_node->GetObject<Ipv4> (), 0);
   632       m_dropTrace (ipHeader, packet, DROP_NO_ROUTE, m_node->GetObject<Ipv4> (), 0);