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

fix: report multiple addresses per interface on Linux and macOS #34

Closed de-vri-es closed 1 year ago

de-vri-es commented 1 year ago

This PR changes NetworkInterface::addr to a Vec<Addr>, and ensures that the Linux and Mac implementation merge all entries for one interface into a single NetworkInterface.

This is a breaking change, of course. But it addresses #26 and #30, although the Windows platform still needs to be changed.

I don't know Windows well enough to test it, so the Windows behaviour has been unchanged (but Some(x) is now vec![x]).

EstebanBorai commented 1 year ago

Hi @de-vri-es! Thanks for opening this PR!

Can you please run cargo fmt in this project?

de-vri-es commented 1 year ago

Thanks for the quick review! I ran cargo fmt and force pushed :)

A pre-release would be awesome, I'd like to use it!