forked from p15670423/monkey
Common: Call get_network_interfaces() from get_my_ip_addresses()
This commit is contained in:
parent
247441663d
commit
c82ee2ce97
|
@ -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]:
|
||||
|
|
Loading…
Reference in New Issue