diff -r a6ee8748aee7 src/devices/wifi/wifi-remote-station-manager.cc --- a/src/devices/wifi/wifi-remote-station-manager.cc Fri Apr 16 07:52:54 2010 +0200 +++ b/src/devices/wifi/wifi-remote-station-manager.cc Fri Apr 16 09:00:18 2010 +0200 @@ -138,7 +138,7 @@ " transmission of each packet is obtained before sending the next. Otherwise, we modelize a " " high-latency device, that is a device where we cannot update our decision about tx parameters" " after every packet transmission.", - BooleanValue (true), + BooleanValue (true), // this value is ignored because there is no setter MakeBooleanAccessor (&WifiRemoteStationManager::IsLowLatency), MakeBooleanChecker ()) .AddAttribute ("MaxSsrc", "The maximum number of retransmission attempts for an RTS. This value" @@ -332,8 +332,14 @@ { return; } - TxModeTag tag = TxModeTag (GetRtsMode (address, header, packet), - GetDataMode (address, header, packet, fullPacketSize)); + WifiRemoteStation *station = Lookup (address, header); + WifiMode rts = DoGetRtsMode (station); + WifiMode data = DoGetDataMode (station, fullPacketSize); + TxModeTag tag; + // first, make sure that the tag is not here anymore. + ConstCast (packet)->RemovePacketTag (tag); + tag = TxModeTag (rts, data); + // and then, add it back packet->AddPacketTag (tag); } WifiMode @@ -346,10 +352,9 @@ } if (!IsLowLatency ()) { - // Note: removing the packet below is wrong: what happens in case of retransmissions ??? TxModeTag tag; bool found; - found = ConstCast (packet)->RemovePacketTag (tag); + found = ConstCast (packet)->PeekPacketTag (tag); NS_ASSERT (found); return tag.GetDataMode (); } @@ -364,7 +369,7 @@ { TxModeTag tag; bool found; - found = ConstCast (packet)->RemovePacketTag (tag); + found = ConstCast (packet)->PeekPacketTag (tag); NS_ASSERT (found); return tag.GetRtsMode (); }