diff --git a/testground/benchmark/benchmark/network.py b/testground/benchmark/benchmark/network.py index e92ef6e5d0..59167f3a11 100644 --- a/testground/benchmark/benchmark/network.py +++ b/testground/benchmark/benchmark/network.py @@ -21,6 +21,7 @@ def get_data_ip(params: RunParams) -> ipaddress.IPv4Address: def ip4_addresses() -> List[ipaddress.IPv4Address]: ip_list = [] for interface in netifaces.interfaces(): - for link in netifaces.ifaddresses(interface)[netifaces.AF_INET]: - ip_list.append(ipaddress.IPv4Address(link["addr"])) + if netifaces.AF_INET in netifaces.ifaddresses(interface): + for link in netifaces.ifaddresses(interface)[netifaces.AF_INET]: + ip_list.append(ipaddress.IPv4Address(link["addr"])) return ip_list