Bug 1874

Summary: Ipv4L3Protocol::ProcessFragment: addressCombination and idProto identifiers not properly computed
Product: ns-3 Reporter: Rubén Martínez <rmartinez>
Component: internetAssignee: George Riley <riley>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs, tommaso.pecorella
Priority: P5    
Version: ns-3.19   
Hardware: PC   
OS: Linux   
Attachments: fix-ProcessFragment

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