Bug 1921 - Icmpv6L4Protocol::ForgeEchoRequest returns a malformed packet
Icmpv6L4Protocol::ForgeEchoRequest returns a malformed packet
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: ipv6
ns-3-dev
All All
: P5 enhancement
Assigned To: Tommaso Pecorella
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-31 10:57 UTC by Tommaso Pecorella
Modified: 2014-06-18 13:05 UTC (History)
1 user (show)

See Also:


Attachments
patch (1.35 KB, application/octet-stream)
2014-05-31 10:57 UTC, Tommaso Pecorella
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tommaso Pecorella 2014-05-31 10:57:56 UTC
Created attachment 1843 [details]
patch

This function is pretty much useless as it is (and indeed it is never used).

The reason is: the returned packet doesn't have an IP header, but the ICMP header is added. However, the ICMP header does not have the right checksum. As a consequence, it is malformed.

Not adding the IP header seems a bad choice as well, as the caller will have to add it. This seems trivial, but there is no reason to not do in the function, as the ICMP checksum depends on the IP [pseudo] header.
To be clearer, there is no possible use-case for using this function without having to add the right IP header just after.

As a consequence, the logical thing is to add the IP header as well, much like all the other "Forge" functions do.

This changes the API, but it does for a function that 1) was never used and 2) was bugged. As a consequence, I see no reason preventing the API change.
Comment 1 Tommaso Pecorella 2014-06-18 13:05:30 UTC
10819:f49b201c1884