Bug 1874 - Ipv4L3Protocol::ProcessFragment: addressCombination and idProto identifiers not properly computed
Ipv4L3Protocol::ProcessFragment: addressCombination and idProto identifiers n...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: internet
ns-3.19
PC Linux
: P5 normal
Assigned To: George Riley
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-07 12:31 UTC by Rubén Martínez
Modified: 2014-03-07 16:34 UTC (History)
2 users (show)

See Also:


Attachments
fix-ProcessFragment (808 bytes, application/octet-stream)
2014-03-07 12:31 UTC, Rubén Martínez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rubén Martínez 2014-03-07 12:31:50 UTC
Created attachment 1796 [details]
fix-ProcessFragment

In ip4v-l3-protcol.cc, line 1293

uint64_t addressCombination = uint64_t (ipHeader.GetSource ().Get ()) << 32 & uint64_t (ipHeader.GetDestination ().Get ());
uint32_t idProto = uint32_t (ipHeader.GetIdentification ()) << 16 & uint32_t (ipHeader.GetProtocol ());

These operations should use a logical OR (|) instead of AND (&) otherwise the result is always zero.

Patch attached.
Comment 1 Tommaso Pecorella 2014-03-07 16:34:36 UTC
You're totally right.
Pushed in changeset: 10646:a68b000ae77b