From a7f821d20dc18b18f55c3644e9fb1c0a5c2704e7 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Tue, 1 Feb 2022 14:02:54 +0530 Subject: [PATCH] Agent: Remove unneeded function `is_local_ips` since bootloader telem was removed --- monkey/monkey_island/cc/services/utils/network_utils.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/monkey/monkey_island/cc/services/utils/network_utils.py b/monkey/monkey_island/cc/services/utils/network_utils.py index fc991a1c0..a37cd3250 100644 --- a/monkey/monkey_island/cc/services/utils/network_utils.py +++ b/monkey/monkey_island/cc/services/utils/network_utils.py @@ -1,10 +1,8 @@ import array -import collections import ipaddress import socket import struct import sys -from typing import List from netifaces import AF_INET, ifaddresses, interfaces from ring import lru @@ -53,11 +51,6 @@ else: return result -def is_local_ips(ips: List) -> bool: - filtered_local_ips = [ip for ip in local_ip_addresses() if not ip.startswith("169.254")] - return collections.Counter(ips) == collections.Counter(filtered_local_ips) - - # The local IP addresses list should not change often. Therefore, we can cache the result and # never call this function # more than once. This stopgap measure is here since this function is called a lot of times