From 65f238689a0dd896c9be9af25d84febf21b82976 Mon Sep 17 00:00:00 2001 From: DragonSlayer_14 Date: Thu, 21 Aug 2025 00:43:49 +0200 Subject: [PATCH] =?UTF-8?q?Ref:=20=C3=9Cberarbeitet=20`get=5Fip=5Ffrom=5Fm?= =?UTF-8?q?ac`=20zur=20verbesserten=20Verarbeitung=20von=20`mac`=20und=20L?= =?UTF-8?q?ogging.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/network/utils.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/network/utils.rs b/src/network/utils.rs index 30ccff0..4b5c94f 100644 --- a/src/network/utils.rs +++ b/src/network/utils.rs @@ -114,8 +114,11 @@ pub fn get_ip_from_mac(mac: &str, network: &str) -> Option { log("network_utils", &*stdout, LogLevel::Debug); for line in stdout.lines() { - if line.contains(mac) { - if let Some(ip_line) = line.split('\n').find(|l| l.contains("Nmap scan report for")) { + if line.contains("Nmap scan report for") { + let ip_line = line; + log("network_utils", &*ip_line, LogLevel::Debug); + if let Some(next_line) = stdout.lines().find(|l| l.to_lowercase().contains(mac)) { + log("network_utils", &*next_line, LogLevel::Debug); if let Some(ip) = ip_line.split_whitespace().last() { return Some(ip.to_string()); }