Skip to content

Commit

Permalink
Merge pull request #711 from WojciechMigda/FIX-scan-start-increment
Browse files Browse the repository at this point in the history
Fix increment and start initialization in TX thread
  • Loading branch information
robertdavidgraham committed Nov 1, 2023
2 parents 521e2c6 + b512182 commit 606563e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ transmit_thread(void *v) /*aka. scanning_thread() */
struct TemplateSet pkt_template = templ_copy(parms->tmplset);
struct Adapter *adapter = parms->adapter;
uint64_t packets_sent = 0;
unsigned increment = (masscan->shard.of-1) + masscan->nic_count;
unsigned increment = masscan->shard.of * masscan->nic_count;
unsigned src_ipv4;
unsigned src_ipv4_mask;
unsigned src_port;
Expand Down Expand Up @@ -269,7 +269,7 @@ transmit_thread(void *v) /*aka. scanning_thread() */
* a little bit past the end when we have --retries. Yet another
* thing to do here is deal with multiple network adapters, which
* is essentially the same logic as shards. */
start = masscan->resume.index + (masscan->shard.one-1) + parms->nic_index;
start = masscan->resume.index + (masscan->shard.one-1) * masscan->nic_count + parms->nic_index;
end = range;
if (masscan->resume.count && end > start + masscan->resume.count)
end = start + masscan->resume.count;
Expand Down

0 comments on commit 606563e

Please sign in to comment.