1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Added small option optimization to PDUOption.

This commit is contained in:
Matias Fontanini
2014-05-29 23:15:44 -03:00
parent 559c963d63
commit 356ea2a68a
2 changed files with 110 additions and 13 deletions

View File

@@ -120,7 +120,7 @@ void Dot11ManagementFrame::rsn_information(const RSNInformation& info) {
uint8_t *Dot11ManagementFrame::serialize_rates(const rates_type &rates) {
uint8_t *buffer = new uint8_t[rates.size()], *ptr = buffer;
for(rates_type::const_iterator it = rates.begin(); it != rates.end(); ++it) {
uint8_t result = static_cast<uint8_t>(*it) * 2;
uint8_t result = static_cast<uint8_t>(*it * 2);
if(result == 2 || result == 4 || result == 11 || result == 22)
result |= 0x80;
*(ptr++) = result;