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

getPcapLiveDeviceByIp and some similar functions can only match the first IP address #1683

Open
wangchong2023 opened this issue Jan 5, 2025 · 2 comments

Comments

@wangchong2023
Copy link
Contributor

Sometimes we need to specify a non-first IPv4/IPv6 address under an interface. Currently, interfaces of the same type will only match the first IP address. Can these functions be extended?

@Dimi1010
Copy link
Collaborator

Dimi1010 commented Jan 5, 2025

I assume that you have multiple interfaces with the same IP on a machine?

It should be possible to add a function to return a collection of devices that match the IP instead of a single one, since the normal search is just looping through the list of devices and tries to compare the provided IP with the one on the device, then breaks on the first match.

You are welcome to make a PR with the additions if you want.

@Dimi1010
Copy link
Collaborator

Dimi1010 commented Jan 5, 2025

Also, on the current master branch PcapLiveDevice objects now store their IP addresses as IPAddress objects, so a workaround there is to fetch all the devices from the list and manually loop through their IPs to find the ones you need. This change however was made after v24.09 was released so it is only on the master branch for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants