Bug 601 - Small typo in SequenceControlSmaller (mac-rx-middle.cc)
Small typo in SequenceControlSmaller (mac-rx-middle.cc)
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
ns-3-dev
All All
: P3 minor
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-22 10:37 UTC by Trevor Bosaw
Modified: 2009-06-26 03:46 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Trevor Bosaw 2009-06-22 10:37:58 UTC
In the SequenceControlSmaller function found in the mac-rx-middle.cc file, there is a test:

  if (delta <= 0 && delta < -2048) 
    {
      return true;
    } 
  
However, the second delta test is unnecessary. I'm thinking the second 'less than' sign should in fact be a 'greater than' sign...
Comment 1 Gustavo J. A. M. Carneiro 2009-06-22 12:37:42 UTC
See also: bug 385.
Comment 2 Mathieu Lacage 2009-06-26 02:59:32 UTC
comments from mirko banchi

Original expression is:

if (delta <= 0 && delta < -2048)
   {
    ...
   }

if delta = 0 it's not possible that delta < -2048 so we can remove =.
However if delta < -2048 is true that delta < 0 too, so i think that  
that expression is equal to:

if (delta < -2048)
   {
     ...
   }

and it's wrong.

Could make sense the suggested expression:

if (delta <= 0 && delta > -2048)
   {
     ...
   }
else if (delta >= 0 && delta < 2048)
   {
     ...
   }

However,  are those conditions enough to say that a sequence number  
corresponds to an "old" packet?
Comment 3 Mathieu Lacage 2009-06-26 03:46:40 UTC
changeset 36adfa546b04

test+fix