|
Bugzilla – Full Text Bug Listing |
| Summary: | Small typo in SequenceControlSmaller (mac-rx-middle.cc) | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Trevor Bosaw <bosawt> |
| Component: | wifi | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | gjcarneiro, mathieu.lacage |
| Priority: | P3 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
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?
changeset 36adfa546b04 test+fix |
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...