OMNeT++/OMNEST Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001013OMNeT++simulation kernelpublic2017-05-24 20:292017-05-24 20:29
Reporterpaolinux 
Assigned To 
PrioritylowSeverityminorReproducibilityalways
StatusnewResolutionopen 
Platformx86_64OSWindowsOS Version10
Product Version5.1 
Target VersionFixed in Version 
Summary0001013: The "controlInfo" field is not copied by the message copy constructor
DescriptionI've noticed that the controlInfo pointer associated to a given message is not copied by the copy constructor, i.e., the resulting copy will have controlInfo set to nullptr.

I'm not sure if this actually a bug or is the intended behavior. However, this turns out to incur a non-expected behavior in the controlInfo are associated to an encapsulated packet. Consider the following example;

auto encapsulatedMsg = new cMessage();
encapsulatedMsg.setControlInfo(...);

auto msg = new cMessage();
msg->encapsulate(encapsulatedMsg);

if now I call

msg->getEncapsulatedPacket();

this creates a copy of the object that does not have the controlInfo.

Wouldn't it make more sense to copy the controlInfo pointer to? (ie both the original message and the copy would point to the same memory location)

P.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2017-05-24 20:29 paolinux New Issue


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker