Bug 601

Summary: Small typo in SequenceControlSmaller (mac-rx-middle.cc)
Product: ns-3 Reporter: Trevor Bosaw <bosawt>
Component: wifiAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: minor CC: gjcarneiro, mathieu.lacage
Priority: P3    
Version: ns-3-dev   
Hardware: All   
OS: All   

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