Bug 2537

Summary: Dead assigment on CoDel::DoDequeue
Product: ns-3 Reporter: natale.patriciello
Component: traffic-controlAssignee: Stefano Avallone <stavallo>
Status: RESOLVED FIXED    
Severity: major CC: ns-bugs
Priority: P5    
Version: unspecified   
Hardware: PC   
OS: Linux   
Attachments: Proposed changes

Description natale.patriciello 2016-11-05 07:12:55 UTC
We have two dead assignment on CoDel queue disc. The report of clang static analyzer says the following:

(type, file name, function, line)
Dead assignment	codel-queue-disc.cc	DoDequeue	450
Dead assignment	codel-queue-disc.cc	DoDequeue	463

In fact, by looking at the source code, the value okToDrop is never read after these lines. At line 450 the problem is not very interesting, since the queue is empty (we can safely remove that line). At line 463 however, we ask if it's correct to drop the packet, but then we ignore the result.
Comment 1 Stefano Avallone 2016-11-13 17:22:32 UTC
Created attachment 2675 [details]
Proposed changes
Comment 2 Stefano Avallone 2016-11-13 17:28:47 UTC
Thanks for reporting this. I checked the Linux code (which is the reference implementation for CoDel) and verified that the assignment is actually useless in both cases. I noticed, however, that the ns-3 implementation was slightly different than Linux and some parameters (e.g., m_firstAboveTime) could be incorrectly set.

Attached please find my proposal to make the ns-3 implementation more closely follow the Linux one.
Comment 3 Stefano Avallone 2017-01-27 12:03:51 UTC
Fixed with changeset 12580:e92df2fc93e4, thanks!