always initalize the size of a packet (forgotten on checkpoints
in some places). use the constructor for setting the size. --HG-- extra : convert_revision : fad322c1d45b1952804cf35942b5685d70128e59
This commit is contained in:
parent
e3c3e44ac1
commit
86836124ed
5 changed files with 9 additions and 11 deletions
|
@ -195,7 +195,7 @@ EtherLink::Link::unserialize(Checkpoint *cp, const string §ion)
|
|||
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 §ion)
|
||||
{
|
||||
Event::unserialize(cp, section);
|
||||
packet = new PacketData;
|
||||
packet = new PacketData(16384);
|
||||
packet->unserialize("packet", cp, section);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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 §ion)
|
|||
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 §ion)
|
|||
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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1225,7 +1225,7 @@ Device::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
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 §ion)
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue