Bug 2030 - default values for WifiTxVector
default values for WifiTxVector
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
pre-release
PC Linux
: P5 normal
Assigned To: Tom Henderson
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-16 16:10 EST by Tom Henderson
Modified: 2014-12-19 21:30 EST (History)
1 user (show)

See Also:


Attachments
patch to fix (3.44 KB, patch)
2014-12-17 00:24 EST, Tom Henderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2014-12-16 16:10:23 EST
The WifiTxVector class encapsulate various transmission parameters passed to the PHY.  

The patch to bug 2026 exposed a valgrind warning for using an uninitialized value in the mesh code.  Basically, the problem is that some values should not be used before being initialized, but the mesh code (airtime-metric.cc) is creating some objects with the constructor that provides no arguments:

  WifiTxVector txVector;
  txVector.SetMode (mode)

but not setting the other values before later using txVector.

One solution is to provide default member initializers, but a couple of the variables (mode and txPowerLevel) don't seem to have reasonable defaults.  So, the code should enforce that they are not used before being set either by the constructor that accepts arguments, or by explicitly using the Set() methods.

a brief off-list discussion with Ghada and Sebastien resulted in some consensus to provide non-MIMO defults for m_retries (0), m_shortGuardInterval (false), m_nss (1), m_ness (0), and m_stbc (false), but to require explicit setting of m_mode and m_txPowerLevel before those getters could be used.

suggested patch to fix is forthcoming...
Comment 1 Tom Henderson 2014-12-17 00:24:02 EST
Created attachment 1934 [details]
patch to fix
Comment 2 Tom Henderson 2014-12-19 21:30:02 EST
fixed in changeset:   11115:ee55cea92a18