PcapRemoteDevice's clone method does not work.
Closed this issue · 5 comments
PcapRemoteDevice
's clone method directly inherits from PcapLiveDevice
's clone method.
The method incorrectly attempts to fetch the device from local devices, failing and returning nullptr
.
Solution would be to add an override to the clone method, correctly dispatching to fetch the remote devices, or refactoring the clone call to skip the fetching if possible.
Still present, as the remote device class does not have its own clone
override. I was mostly waiting for the clang format PRs to be done with before I start working on it.
Got it, thanks. The clang-formate might take time because we're moving in small steps. We'll probably save Pcap++ to last because it's the most complex as not everything has tests...
Feel free to start working on it if you have time
Sure.
Btw @seladb , is there a specific reason we are cloning the devices via re-fetching the pcap_if_t
struct? As far as I can see, the struct is only read for the data it has in the constructor, so a simpler private copy constructor could probably be implemented to be used in clone
instead of re-fetching all devices.