GuillaumeGomez / sysinfo

Cross-platform library to fetch system information
MIT License
2.17k stars 320 forks source link

Add support for sub-interfaces in network_helper::get_interface_ip_networks #1366

Closed stormshield-gwendald closed 1 month ago

stormshield-gwendald commented 1 month ago

getifaddrs in get_interface_ip_networks will return sub-interfaces with the format <interface name>:<interface index>, but this sub-interfaces are not presented in /sys/class/net/, so this sub-interfaces are skipped in refresh_networks_addresses.

This PR fix this by overriding the sub-interfaces name with their parents interfaces name in get_interface_ip_networks.

GuillaumeGomez commented 1 month ago

Nice, thanks!