Skip to content

Commit

Permalink
Fix getRawPacketReadOnly() const-correctness #1573 (#1637)
Browse files Browse the repository at this point in the history
* Fix getRawPacketReadOnly() const-correctness #1573

* fix kni

* fix clang-format

* Add ignore list for clang-tidy

* Revert "Add ignore list for clang-tidy"

This reverts commit dc3783c.
  • Loading branch information
egecetin authored Nov 8, 2024
1 parent 426ad95 commit 2c50e2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
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

0 comments on commit 2c50e2e

Please sign in to comment.