--- a/src/mesh/model/mesh-wifi-interface-mac.cc Sat Aug 15 19:30:10 2015 +0200
+++ b/src/mesh/model/mesh-wifi-interface-mac.cc Mon Aug 17 13:44:25 2015 -0700
@@ -220,7 +220,7 @@
// copy packet to allow modifications
Ptr<Packet> packet = const_packet->Copy ();
WifiMacHeader hdr;
- hdr.SetTypeData ();
+ hdr.SetType (WIFI_MAC_QOSDATA);
hdr.SetAddr2 (GetAddress ());
hdr.SetAddr3 (to);
hdr.SetAddr4 (from);
@@ -255,19 +255,20 @@
}
m_stationManager->RecordDisassociated (hdr.GetAddr1 ());
}
- //Classify: application sets a tag, which is removed here
- // Get Qos tag:
- AcIndex ac = AC_BE;
+ // Classify: application may have set a tag, which is removed here
+ AcIndex ac;
QosTag tag;
if (packet->RemovePacketTag (tag))
{
- hdr.SetType (WIFI_MAC_QOSDATA);
hdr.SetQosTid (tag.GetTid ());
- //Aftre setting type DsFrom and DsTo fields are reset.
- hdr.SetDsFrom ();
- hdr.SetDsTo ();
ac = QosUtilsMapTidToAc (tag.GetTid ());
}
+ else
+ {
+ // No tag found; set to best effort
+ ac = AC_BE;
+ hdr.SetQosTid (0);
+ }
m_stats.sentFrames++;
m_stats.sentBytes += packet->GetSize ();
NS_ASSERT (m_edca.find (ac) != m_edca.end ());
--- a/src/wifi/model/qos-utils.cc Sat Aug 15 19:30:10 2015 +0200
+++ b/src/wifi/model/qos-utils.cc Mon Aug 17 13:44:25 2015 -0700
@@ -27,6 +27,7 @@
AcIndex
QosUtilsMapTidToAc (uint8_t tid)
{
+ NS_ASSERT_MSG (tid < 8, "Tid " << (uint16_t) tid << " out of range");
switch (tid)
{
case 0: