Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getRawPacketReadOnly() const-correctness #1573 #1637

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Packet++/header/Packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ namespace pcpp
* Get a pointer to the Packet's RawPacket in a read-only manner
* @return A pointer to the Packet's RawPacket
*/
RawPacket* getRawPacketReadOnly() const
const RawPacket* getRawPacketReadOnly() const
{
return m_RawPacket;
}
Expand Down
3 changes: 1 addition & 2 deletions Pcap++/src/KniDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,11 +610,10 @@ namespace pcpp
MBufRawPacket** allocated = CPP_VLA(MBufRawPacket*, arrLength);
uint16_t allocated_count = 0, packetsSent = 0;
MBufRawPacket* rawPacket;
RawPacket* raw_pkt;

for (uint16_t i = 0; i < arrLength; ++i)
{
raw_pkt = packetsArr[i]->getRawPacketReadOnly();
const auto *raw_pkt = packetsArr[i]->getRawPacketReadOnly();
uint8_t raw_type = raw_pkt->getObjectType();
if (raw_type != MBUFRAWPACKET_OBJECT_TYPE)
{
Expand Down
Loading