diff --git a/src/ipv4.rs b/src/ipv4.rs index 989463a..ae2a50f 100644 --- a/src/ipv4.rs +++ b/src/ipv4.rs @@ -71,7 +71,7 @@ impl IPv4Range { Self { id_start: from, id_end: to, - id_ignore + id_ignore: id_ignore.to_vec() } } } diff --git a/src/scanner.rs b/src/scanner.rs index 0cdaee1..8ef6902 100644 --- a/src/scanner.rs +++ b/src/scanner.rs @@ -56,7 +56,7 @@ fn start_scan( to: u32, target_port: u16, num_threads: u32, - ignorelist: Option<&mut Vec>, + ignorelist: Option>, ) -> Result<()> { println!("Starting wwmap..."); @@ -67,14 +67,14 @@ fn start_scan( let mut threads: Vec>> = Vec::new(); for thread_id in 0..num_threads { - let thread_ignorelist = ignorelist.unwrap_or(&mut Vec::new()); + let id_ignorelist = ignorelist.unwrap().cloned().unwrap_or_else(Vec::new()); // Create a worker let worker = create_scan_worker( thread_id, ips_per_thread, target_port, - thread_ignorelist + id_ignorelist ); threads.push(worker); }