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

getIPAddressFromMAC returns link-local IPv6 #76

Open
rainmasak opened this issue Sep 16, 2020 · 1 comment
Open

getIPAddressFromMAC returns link-local IPv6 #76

rainmasak opened this issue Sep 16, 2020 · 1 comment

Comments

@rainmasak
Copy link

rainmasak commented Sep 16, 2020

getAllIPAndMACAddressesInARPCache() returns two items with same value. (one for IPv4, one for link-local IPv6)
While iterating over keys, it encounters the wrong key/value pair first and therefore getIPAddressFromMAC returns the wrong key.

I suggest you either let user decide, which IP format they prefer (IPv6 or IPv4), or check for IP pattern before return (according to documentation, it should return IP in format "192.168.0.1")

image

@rainmasak rainmasak changed the title getIPAddressFromMAC returns IPv6 getIPAddressFromMAC returns link-local IPv6 Sep 16, 2020
@stealthcopter
Copy link
Owner

Ah good find. I will fix this in the next version!

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