summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev/etherlink.cc4
-rw-r--r--dev/ethertap.cc3
-rw-r--r--dev/ns_gige.cc7
-rw-r--r--dev/pktfifo.cc2
-rw-r--r--dev/sinic.cc4
5 files changed, 9 insertions, 11 deletions
diff --git a/dev/etherlink.cc b/dev/etherlink.cc
index 1e2be41fe..d637e152a 100644
--- a/dev/etherlink.cc
+++ b/dev/etherlink.cc
@@ -195,7 +195,7 @@ EtherLink::Link::unserialize(Checkpoint *cp, const string &section)
bool packet_exists;
UNSERIALIZE_SCALAR(packet_exists);
if (packet_exists) {
- packet = new PacketData;
+ packet = new PacketData(16384);
packet->unserialize("packet", cp, section);
}
@@ -244,7 +244,7 @@ void
LinkDelayEvent::unserialize(Checkpoint *cp, const string &section)
{
Event::unserialize(cp, section);
- packet = new PacketData;
+ packet = new PacketData(16384);
packet->unserialize("packet", cp, section);
}
diff --git a/dev/ethertap.cc b/dev/ethertap.cc
index 03f2724b1..1603a9bd3 100644
--- a/dev/ethertap.cc
+++ b/dev/ethertap.cc
@@ -219,8 +219,7 @@ EtherTap::process(int revent)
while (data_len != 0 && buffer_offset >= data_len + sizeof(u_int32_t)) {
PacketPtr packet;
- packet = new PacketData;
- packet->data = new uint8_t[data_len];
+ packet = new PacketData(data_len);
packet->length = data_len;
memcpy(packet->data, data, data_len);
diff --git a/dev/ns_gige.cc b/dev/ns_gige.cc
index c650c7943..c5489d5ee 100644
--- a/dev/ns_gige.cc
+++ b/dev/ns_gige.cc
@@ -1767,8 +1767,7 @@ NSGigE::txKick()
case txFifoBlock:
if (!txPacket) {
DPRINTF(EthernetSM, "****starting the tx of a new packet****\n");
- txPacket = new PacketData;
- txPacket->data = new uint8_t[16384];
+ txPacket = new PacketData(16384);
txPacketBufPtr = txPacket->data;
}
@@ -2257,7 +2256,7 @@ NSGigE::unserialize(Checkpoint *cp, const std::string &section)
bool txPacketExists;
UNSERIALIZE_SCALAR(txPacketExists);
if (txPacketExists) {
- txPacket = new PacketData;
+ txPacket = new PacketData(16384);
txPacket->unserialize("txPacket", cp, section);
uint32_t txPktBufPtr;
UNSERIALIZE_SCALAR(txPktBufPtr);
@@ -2269,7 +2268,7 @@ NSGigE::unserialize(Checkpoint *cp, const std::string &section)
UNSERIALIZE_SCALAR(rxPacketExists);
rxPacket = 0;
if (rxPacketExists) {
- rxPacket = new PacketData;
+ rxPacket = new PacketData(16384);
rxPacket->unserialize("rxPacket", cp, section);
uint32_t rxPktBufPtr;
UNSERIALIZE_SCALAR(rxPktBufPtr);
diff --git a/dev/pktfifo.cc b/dev/pktfifo.cc
index 00c12ce68..ae82123cf 100644
--- a/dev/pktfifo.cc
+++ b/dev/pktfifo.cc
@@ -63,7 +63,7 @@ PacketFifo::unserialize(const string &base, Checkpoint *cp,
fifo.resize(fifosize);
for (int i = 0; i < fifosize; ++i) {
- PacketPtr p = new PacketData;
+ PacketPtr p = new PacketData(16384);
p->unserialize(csprintf("%s.packet%d", base, i), cp, section);
fifo.push_back(p);
}
diff --git a/dev/sinic.cc b/dev/sinic.cc
index 4dff59a5a..56782b589 100644
--- a/dev/sinic.cc
+++ b/dev/sinic.cc
@@ -1225,7 +1225,7 @@ Device::unserialize(Checkpoint *cp, const std::string &section)
UNSERIALIZE_SCALAR(rxPacketExists);
rxPacket = 0;
if (rxPacketExists) {
- rxPacket = new PacketData;
+ rxPacket = new PacketData(16384);
rxPacket->unserialize("rxPacket", cp, section);
uint32_t rxPktBufPtr;
UNSERIALIZE_SCALAR(rxPktBufPtr);
@@ -1245,7 +1245,7 @@ Device::unserialize(Checkpoint *cp, const std::string &section)
UNSERIALIZE_SCALAR(txPacketExists);
txPacket = 0;
if (txPacketExists) {
- txPacket = new PacketData;
+ txPacket = new PacketData(16384);
txPacket->unserialize("txPacket", cp, section);
uint32_t txPktBufPtr;
UNSERIALIZE_SCALAR(txPktBufPtr);