forked from p34709852/monkey
Agent: Remove unneeded function `is_local_ips` since bootloader telem was removed
This commit is contained in:
parent
db965e14f8
commit
a7f821d20d
|
@ -1,10 +1,8 @@
|
||||||
import array
|
import array
|
||||||
import collections
|
|
||||||
import ipaddress
|
import ipaddress
|
||||||
import socket
|
import socket
|
||||||
import struct
|
import struct
|
||||||
import sys
|
import sys
|
||||||
from typing import List
|
|
||||||
|
|
||||||
from netifaces import AF_INET, ifaddresses, interfaces
|
from netifaces import AF_INET, ifaddresses, interfaces
|
||||||
from ring import lru
|
from ring import lru
|
||||||
|
@ -53,11 +51,6 @@ else:
|
||||||
return result
|
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
|
# The local IP addresses list should not change often. Therefore, we can cache the result and
|
||||||
# never call this function
|
# never call this function
|
||||||
# more than once. This stopgap measure is here since this function is called a lot of times
|
# more than once. This stopgap measure is here since this function is called a lot of times
|
||||||
|
|
Loading…
Reference in New Issue