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

feat(windows): group ip addresses to interfaces based on interface index #55

Closed scanban closed 5 months ago

scanban commented 5 months ago

On Linux, all ip addresses of each interface are stored in a single NetworkInterface structure. On windows each IP address was stored in a distinct NetworkInterface structure. With this change, windows output structure is now the same as on Linux - one NetworkInterface structure for each network interface.

EstebanBorai commented 5 months ago

Hi @scanban, I think this will break current Windows users impls right?

scanban commented 5 months ago

Hi @scanban, I think this will break current Windows users impls right?

depends, the only problem for them is that now each NetworkInterface have multiple addresses. But this is exactly how it works on linux. So cross platform code should work as it is.

EstebanBorai commented 5 months ago

Hi @scanban, I think this will break current Windows users impls right?

depends, the only problem for them is that now each NetworkInterface have multiple addresses.

But this is exactly how it works on linux. So cross platform code should work as it is.

Makes sense. Thanks for sharing.

ArcticLampyrid commented 5 months ago

I think this will break current Windows users impls right?

I think this is a fix more than a feature. Intuitively, multiple addresses of the same interface should not be considered as multiple NetworkInterface.