--- a/CHANGES.html Tue Jun 17 23:31:52 2014 +0200
+++ b/CHANGES.html Wed Jun 18 19:03:10 2014 +0200
@@ -58,6 +58,8 @@
<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>
--- a/RELEASE_NOTES Tue Jun 17 23:31:52 2014 +0200
+++ b/RELEASE_NOTES Wed Jun 18 19:03:10 2014 +0200
@@ -24,6 +24,7 @@
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.
--- a/src/internet/model/icmpv6-l4-protocol.cc Tue Jun 17 23:31:52 2014 +0200
+++ b/src/internet/model/icmpv6-l4-protocol.cc Wed Jun 18 19:03:10 2014 +0200
@@ -588,8 +588,17 @@
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;
}
--- a/src/internet/model/icmpv6-l4-protocol.h Tue Jun 17 23:31:52 2014 +0200
+++ b/src/internet/model/icmpv6-l4-protocol.h Wed Jun 18 19:03:10 2014 +0200
@@ -329,7 +329,7 @@
* \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);