E. Almqvist 2 years ago
parent 3154903bec
commit e81a0d9b2b
  1. 2
      src/ipv4.rs
  2. 6
      src/scanner.rs

@ -71,7 +71,7 @@ impl IPv4Range {
Self { Self {
id_start: from, id_start: from,
id_end: to, id_end: to,
id_ignore id_ignore: id_ignore.to_vec()
} }
} }
} }

@ -56,7 +56,7 @@ fn start_scan(
to: u32, to: u32,
target_port: u16, target_port: u16,
num_threads: u32, num_threads: u32,
ignorelist: Option<&mut Vec<u32>>, ignorelist: Option<Vec<u32>>,
) -> Result<()> { ) -> Result<()> {
println!("Starting wwmap..."); println!("Starting wwmap...");
@ -67,14 +67,14 @@ fn start_scan(
let mut threads: Vec<JoinHandle<Vec<bool>>> = Vec::new(); let mut threads: Vec<JoinHandle<Vec<bool>>> = Vec::new();
for thread_id in 0..num_threads { 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 // Create a worker
let worker = create_scan_worker( let worker = create_scan_worker(
thread_id, thread_id,
ips_per_thread, ips_per_thread,
target_port, target_port,
thread_ignorelist id_ignorelist
); );
threads.push(worker); threads.push(worker);
} }

Loading…
Cancel
Save