From c82ee2ce97b782c8ab223ed625bdf3ef15c5bc5a Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 16 Sep 2022 08:52:54 -0400 Subject: [PATCH] Common: Call get_network_interfaces() from get_my_ip_addresses() --- monkey/common/network/network_utils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/monkey/common/network/network_utils.py b/monkey/common/network/network_utils.py index f2afe47ae..f04e5a64e 100644 --- a/monkey/common/network/network_utils.py +++ b/monkey/common/network/network_utils.py @@ -6,11 +6,7 @@ from netifaces import AF_INET, ifaddresses, interfaces def get_my_ip_addresses() -> Sequence[str]: - ip_list = [] - for interface in interfaces(): - addresses = ifaddresses(interface).get(AF_INET, []) - ip_list.extend([link["addr"] for link in addresses if link["addr"] != "127.0.0.1"]) - return ip_list + return [str(interface.ip) for interface in get_network_interfaces()] def get_network_interfaces() -> List[IPv4Interface]: