src/internet-stack/udp-socket-impl.cc
changeset 4502 07d34c0d8d18
parent 4472 e20a31541404
child 4505 e865dbc1d157
equal deleted inserted replaced
4488:1faf35545dfd 4502:07d34c0d8d18
   323   // the same as a unicast, but it will be fixed further down the stack
   323   // the same as a unicast, but it will be fixed further down the stack
   324   if (m_ipMulticastTtl != 0 && dest.IsMulticast ())
   324   if (m_ipMulticastTtl != 0 && dest.IsMulticast ())
   325     {
   325     {
   326       SocketIpTtlTag tag;
   326       SocketIpTtlTag tag;
   327       tag.SetTtl (m_ipMulticastTtl);
   327       tag.SetTtl (m_ipMulticastTtl);
   328       p->AddTag (tag);
   328       p->AddPacketTag (tag);
   329     }
   329     }
   330   else if (m_ipTtl != 0 && !dest.IsMulticast () && !dest.IsBroadcast ())
   330   else if (m_ipTtl != 0 && !dest.IsMulticast () && !dest.IsBroadcast ())
   331     {
   331     {
   332       SocketIpTtlTag tag;
   332       SocketIpTtlTag tag;
   333       tag.SetTtl (m_ipTtl);
   333       tag.SetTtl (m_ipTtl);
   334       p->AddTag (tag);
   334       p->AddPacketTag (tag);
   335     }
   335     }
   336   {
   336   {
   337     SocketSetDontFragmentTag tag;
   337     SocketSetDontFragmentTag tag;
   338     bool found = p->FindFirstMatchingTag (tag);
   338     bool found = p->RemovePacketTag (tag);
   339     if (!found)
   339     if (!found)
   340       {
   340       {
   341         if (m_mtuDiscover)
   341         if (m_mtuDiscover)
   342           {
   342           {
   343             tag.Enable ();
   343             tag.Enable ();
   344           }
   344           }
   345         else
   345         else
   346           {
   346           {
   347             tag.Disable ();
   347             tag.Disable ();
   348           }
   348           }
   349         p->AddTag (tag);
   349         p->AddPacketTag (tag);
   350       }
   350       }
   351   }
   351   }
   352   //
   352   //
   353   // If dest is set to the limited broadcast address (all ones),
   353   // If dest is set to the limited broadcast address (all ones),
   354   // convert it to send a copy of the packet out of every 
   354   // convert it to send a copy of the packet out of every 
   488   Ptr<Packet> packet = Recv (maxSize, flags);
   488   Ptr<Packet> packet = Recv (maxSize, flags);
   489   if (packet != 0)
   489   if (packet != 0)
   490     {
   490     {
   491       SocketAddressTag tag;
   491       SocketAddressTag tag;
   492       bool found;
   492       bool found;
   493       found = packet->FindFirstMatchingTag (tag);
   493       found = packet->PeekPacketTag (tag);
   494       NS_ASSERT (found);
   494       NS_ASSERT (found);
   495       fromAddress = tag.GetAddress ();
   495       fromAddress = tag.GetAddress ();
   496     }
   496     }
   497   return packet;
   497   return packet;
   498 }
   498 }
   552   if ((m_rxAvailable + packet->GetSize ()) <= m_rcvBufSize)
   552   if ((m_rxAvailable + packet->GetSize ()) <= m_rcvBufSize)
   553     {
   553     {
   554       Address address = InetSocketAddress (ipv4, port);
   554       Address address = InetSocketAddress (ipv4, port);
   555       SocketAddressTag tag;
   555       SocketAddressTag tag;
   556       tag.SetAddress (address);
   556       tag.SetAddress (address);
   557       packet->AddTag (tag);
   557       packet->AddPacketTag (tag);
   558       m_deliveryQueue.push (packet);
   558       m_deliveryQueue.push (packet);
   559       m_rxAvailable += packet->GetSize ();
   559       m_rxAvailable += packet->GetSize ();
   560       NotifyDataRecv ();
   560       NotifyDataRecv ();
   561     }
   561     }
   562   else
   562   else