summaryrefslogtreecommitdiff
path: root/src/dev/net/etherpkt.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/dev/net/etherpkt.hh')
-rw-r--r--src/dev/net/etherpkt.hh9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/dev/net/etherpkt.hh b/src/dev/net/etherpkt.hh
index f84c03a4c..a9cc79b80 100644
--- a/src/dev/net/etherpkt.hh
+++ b/src/dev/net/etherpkt.hh
@@ -55,6 +55,11 @@ class EthPacketData
uint8_t *data;
/**
+ * Total size of the allocated data buffer.
+ */
+ unsigned bufLength;
+
+ /**
* Amount of space occupied by the payload in the data buffer
*/
unsigned length;
@@ -69,11 +74,11 @@ class EthPacketData
unsigned simLength;
EthPacketData()
- : data(nullptr), length(0), simLength(0)
+ : data(nullptr), bufLength(0), length(0), simLength(0)
{ }
explicit EthPacketData(unsigned size)
- : data(new uint8_t[size]), length(0), simLength(0)
+ : data(new uint8_t[size]), bufLength(size), length(0), simLength(0)
{ }
~EthPacketData() { if (data) delete [] data; }