[Ns-bugs] [Bug 273] method arguments of type Ptr<Packet> are way too fragile in public API

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Thu Aug 7 12:30:20 PDT 2008


http://www.nsnam.org/bugzilla/show_bug.cgi?id=273





------- Comment #4 from mathieu.lacage at sophia.inria.fr  2008-08-07 15:30 -------
(In reply to comment #2)
> Created an attachment (id=221)
 --> (http://www.nsnam.org/bugzilla/attachment.cgi?id=221&action=view) [details]
> change the upcalls to use const.

I changed only the upcalls in this patch because the downcalls are much less
problematic and much less potentially subject to bugs so, I guess I could live
with them. I think that the crux of the rationale we should use is that, if you
have multiple receivers for a packet, you should use const and, if not, you can
conceivably, in the name of efficiency, pass a non-const. 

I personally would just pass const all the time if I had to chose though and
that would mean changing Queue::Enqueue and Queue::Dequeue.

Until we get to the downcalls, the upcalls look pretty safe to me and do
improve quite a bit the situation of NetDevice implementors so, I would like to
check them in asap. Comments ?


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Ns-bugs mailing list