internet: (fixes #2440) SocketIpTosTag might be added twice if a packet is sent multiple times

This commit is contained in:
Stefano Avallone
2016-06-15 16:15:56 +02:00
parent e9e80fa69a
commit a2e4d75c84
2 changed files with 3 additions and 1 deletions

View File

@@ -489,7 +489,8 @@ UdpSocketImpl::DoSendTo (Ptr<Packet> p, Ipv4Address dest, uint16_t port)
{
SocketIpTosTag ipTosTag;
ipTosTag.SetTos (GetIpTos ());
p->AddPacketTag (ipTosTag);
// This packet may already have a SocketIpTosTag (see BUG 2440)
p->ReplacePacketTag (ipTosTag);
}
Ptr<Ipv4> ipv4 = m_node->GetObject<Ipv4> ();