EstebanBorai / network-interface

Retrieve system's Network Interfaces on Linux, macOS and Windows on a standardized manner
https://crates.io/crates/network-interface
Apache License 2.0
61 stars 28 forks source link

NetworkInterface may have multiple ip addresses. #30

Closed mokeyish closed 1 year ago

mokeyish commented 1 year ago

IPv4 and IPv6 address may exist on the same network interface. But https://github.com/EstebanBorai/network-interface/blob/bb5527352ae9e694afd50a09a7cea5b85e0d8604/src/interface.rs#L17

Please refer here https://github.com/dotnet/runtime/blob/84b839e7c50de58a9d92fe0e3ed235630ee12fff/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/NetworkInterface.cs#L64

https://stackoverflow.com/questions/9855230/how-do-i-get-the-network-interface-and-its-right-ipv4-address

RReverser commented 1 year ago

Duplicate of #26, see https://github.com/EstebanBorai/network-interface/issues/26#issuecomment-1530432906.

EstebanBorai commented 1 year ago

Closing as completed! Thanks for sharing @RReverser!