Index: src/dsr/model/dsr-fs-header.cc |
=================================================================== |
--- a/src/dsr/model/dsr-fs-header.cc |
+++ b/src/dsr/model/dsr-fs-header.cc |
@@ -158,7 +158,7 @@ |
m_payloadLen = i.ReadU16 (); |
uint32_t dataLength = GetPayloadLength (); |
- uint8_t data[dataLength]; |
+ uint8_t* data = new uint8_t[dataLength]; |
i.Read (data, dataLength); |
if (dataLength > m_data.GetSize ()) |
@@ -196,7 +196,7 @@ |
{ |
start.Write (m_optionData.Begin (), m_optionData.End ()); |
DsrOptionHeader::Alignment align = {4,0}; |
- uint32_t fill = CalculatePad (align); |
+ uint8_t fill = CalculatePad (align); |
NS_LOG_LOGIC ("fill with " << fill << " bytes padding"); |
switch (fill) |
{ |
@@ -213,7 +213,7 @@ |
uint32_t DsrOptionField::Deserialize (Buffer::Iterator start, uint32_t length) |
{ |
- uint8_t buf[length]; |
+ uint8_t* buf = new uint8_t[length]; |
start.Read (buf, length); |
m_optionData = Buffer (); |
m_optionData.AddAtEnd (length); |
@@ -225,7 +225,7 @@ |
{ |
NS_LOG_FUNCTION_NOARGS (); |
- uint32_t pad = CalculatePad (option.GetAlignment ()); |
+ uint8_t pad = CalculatePad (option.GetAlignment ()); |
NS_LOG_LOGIC ("need " << pad << " bytes padding"); |
switch (pad) |
{ |
@@ -245,7 +245,7 @@ |
option.Serialize (it); |
} |
-uint32_t DsrOptionField::CalculatePad (DsrOptionHeader::Alignment alignment) const |
+uint8_t DsrOptionField::CalculatePad (DsrOptionHeader::Alignment alignment) const |
{ |
return (alignment.offset - (m_optionData.GetSize () + m_optionsOffset)) % alignment.factor; |
} |