Bugzilla – Bug 2537
Dead assigment on CoDel::DoDequeue
Last modified: 2017-01-27 12:03:51 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.
Created attachment 2675 [details] Proposed changes
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.
Fixed with changeset 12580:e92df2fc93e4, thanks!