From 6cc22afd9b4b63aacc98dfacf82f082de0cac460 Mon Sep 17 00:00:00 2001 From: Shreya Date: Tue, 4 May 2021 17:17:51 +0530 Subject: [PATCH] Remove unused `get_ip_for_connection()` in `infection_monkey/network/info.py` --- monkey/infection_monkey/network/info.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/monkey/infection_monkey/network/info.py b/monkey/infection_monkey/network/info.py index 5ada2e29f..5bdce4887 100644 --- a/monkey/infection_monkey/network/info.py +++ b/monkey/infection_monkey/network/info.py @@ -157,22 +157,3 @@ def get_interfaces_ranges(): # limit subnet scans to class C only res.append(CidrRange(cidr_range="%s/%s" % (address_str, netmask_str))) return res - - -if is_windows_os(): - - def get_ip_for_connection(target_ip): - return None - - -else: - - def get_ip_for_connection(target_ip): - try: - query_str = "ip route get %s" % target_ip - resp = check_output(query_str.split()) - substr = resp.split() - src = substr[substr.index("src") + 1] - return src - except Exception: - return None