Skip to content

Commit

Permalink
Attempt to fix dpdk device fetch by port.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimi1010 committed Jul 29, 2024
1 parent 85a35f5 commit ed143d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Pcap++/src/DpdkDeviceList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ DpdkDevice* DpdkDeviceList::getDeviceByPort(int portId) const
return nullptr;
}

return m_DeviceList.at(portId);
// Hack because the device list returns a pointer to const, when the device list is const qualified.
return const_cast<DpdkDevice*>(m_DeviceList.at(portId));
}

DpdkDevice* DpdkDeviceList::getDeviceByPciAddress(const std::string& pciAddr) const
Expand Down

0 comments on commit ed143d7

Please sign in to comment.