Bug 1921 - Icmpv6L4Protocol::ForgeEchoRequest returns a malformed packet

This commit is contained in:
Tommaso Pecorella
2014-06-18 19:03:10 +02:00
parent b7a3cff456
commit 6bde2bde12
4 changed files with 13 additions and 1 deletions

View File

@@ -58,6 +58,8 @@ us a note on ns-developers mailing list.</p>
<h2>Changes to existing API:</h2>
<ul>
<li> "Icmpv6L4Protocol::ForgeEchoRequest" is now returning a packet with the proper IPv6 header.
</li>
</ul>
<h2>Changes to build system:</h2>

View File

@@ -24,6 +24,7 @@ New user-visible features
Bugs fixed
----------
- Bug 1921 - Icmpv6L4Protocol::ForgeEchoRequest returns a malformed packet
- Bug 1930 - Use of invalid reference in OLSR RemoveLinkTuple
- Bug 1932 - NdiscCache entry is not failsafe on double neighbor probing.

View File

@@ -588,8 +588,17 @@ Ptr<Packet> Icmpv6L4Protocol::ForgeEchoRequest (Ipv6Address src, Ipv6Address dst
req.SetId (id);
req.SetSeq (seq);
req.CalculatePseudoHeaderChecksum (src, dst, p->GetSize () + req.GetSerializedSize (), PROT_NUMBER);
p->AddHeader (req);
ipHeader.SetSourceAddress (src);
ipHeader.SetDestinationAddress (dst);
ipHeader.SetNextHeader (PROT_NUMBER);
ipHeader.SetPayloadLength (p->GetSize ());
ipHeader.SetHopLimit (255);
p->AddHeader (ipHeader);
return p;
}

View File

@@ -329,7 +329,7 @@ public:
* \param id ID of the packet
* \param seq sequence number
* \param data the data
* \return Echo Request packet (without IPv6 header)
* \return Echo Request packet (with IPv6 header)
*/
Ptr<Packet> ForgeEchoRequest (Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr<Packet> data);