diff --git a/monkey/common/network/network_utils.py b/monkey/common/network/network_utils.py index ce8002d0c..0ea079239 100644 --- a/monkey/common/network/network_utils.py +++ b/monkey/common/network/network_utils.py @@ -1,12 +1,16 @@ import ipaddress -from ipaddress import IPv4Interface +from ipaddress import IPv4Address, IPv4Interface from typing import List, Optional, Sequence, Tuple from netifaces import AF_INET, ifaddresses, interfaces def get_my_ip_addresses_legacy() -> Sequence[str]: - return [str(interface.ip) for interface in get_network_interfaces()] + return [str(ip) for ip in get_my_ip_addresses()] + + +def get_my_ip_addresses() -> Sequence[IPv4Address]: + return [interface.ip for interface in get_network_interfaces()] def get_network_interfaces() -> List[IPv4Interface]: