Bug 1395 - AODV DeferredRouteOutputTag is a bug.
AODV DeferredRouteOutputTag is a bug.
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: aodv
ns-3-dev
All All
: P3 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-20 16:54 UTC by Tommaso Pecorella
Modified: 2012-03-25 07:47 UTC (History)
0 users

See Also:


Attachments
Fix for the Aodv DeferredOutputTag malformed tag (1.07 KB, patch)
2012-03-23 20:29 UTC, Tommaso Pecorella
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tommaso Pecorella 2012-03-20 16:54:42 UTC
The function is seldom used, but it's useful.
Plus the bug could affect also PacketTags scanning.

If (in any portion of the code) you do this:

std::cout << "Tags: ";
packet->PrintPacketTags(std::cout);
std::cout << std::endl;

the result is:

Tags: assert failed. cond="item.GetTypeId ().HasConstructor ()", file=../src/network/model/packet.cc, line=871

I don't know when this was broken, but it worked once upon a time (in the west).

I checked if I can fix it, but I couldn't spot the bug. Adding Mathieu to the CC'ers as it seems that he was the original author.

T.
Comment 1 Mathieu Lacage 2012-03-23 12:10:01 UTC
This simply means that one of our Header or Trailer subclasses is missing a call to AddConstructor from its GetTypeId method
Comment 2 Tommaso Pecorella 2012-03-23 12:14:05 UTC
(In reply to comment #1)
> This simply means that one of our Header or Trailer subclasses is missing a
> call to AddConstructor from its GetTypeId method

The bug is in the code, but it's not where I assumed it was.

/// Tag used by AODV implementation
struct DeferredRouteOutputTag : public Tag
^^^^

Moreover this tag does not have a constructor defined in the GetTypeId function.

This is definitely a bad idea. A leakage of this tag into the upper layers was causing this bug.

Changing the bug name and scope.
Comment 3 Tommaso Pecorella 2012-03-23 20:29:50 UTC
Created attachment 1367 [details]
Fix for the Aodv DeferredOutputTag malformed tag

Simple patch. Just changed the struct to a class and added the proper constructor.
Comment 4 Tommaso Pecorella 2012-03-25 07:47:49 UTC
fixed in changeset 7792 - e3d19bee62e8