Bug 2030

Summary: default values for WifiTxVector
Product: ns-3 Reporter: Tom Henderson <tomh>
Component: wifiAssignee: Tom Henderson <tomh>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs
Priority: P5    
Version: pre-release   
Hardware: PC   
OS: Linux   
Attachments: patch to fix

Description Tom Henderson 2014-12-16 16:10:23 UTC
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 UTC
Created attachment 1934 [details]
patch to fix
Comment 2 Tom Henderson 2014-12-19 21:30:02 UTC
fixed in changeset:   11115:ee55cea92a18