AndroidNetworkTools icon indicating copy to clipboard operation
AndroidNetworkTools copied to clipboard

getIPAddressFromMAC returns link-local IPv6

Open rainmasak opened this issue 5 years ago • 1 comments

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 avatar Sep 16 '20 22:09 rainmasak

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

stealthcopter avatar Sep 26 '20 10:09 stealthcopter