Index: idle_scan.cc =================================================================== --- idle_scan.cc (revision 24749) +++ idle_scan.cc (working copy) @@ -303,6 +303,14 @@ proxy->max_groupsz = (o.max_parallelism)? o.max_parallelism : 100; proxy->min_groupsz = (o.min_parallelism)? o.min_parallelism : 4; + + /* Prevent performance values from getting out of whack */ + if (proxy->min_groupsz > proxy->max_groupsz) { + error( "WARNING: Idle scan max_groupsz (%i) would have been below min_groupsz (%i). max_groupsz will be set to %i.", + proxy->max_groupsz, proxy->min_groupsz, proxy->min_groupsz ); + proxy->max_groupsz = proxy->min_groupsz; + } + proxy->max_senddelay = 100000; Strncpy(name, proxyName, sizeof(name)); Index: NmapOps.cc =================================================================== --- NmapOps.cc (revision 24749) +++ NmapOps.cc (working copy) @@ -478,10 +478,6 @@ fatal("Sorry -- IPv6 support is currently only available for TCP, UDP, and SCTP port scans and list scan (-sL). OS detection, random targets and decoys are also not supported with IPv6. Further support is under consideration."); } - /* Prevent performance values from getting out of whack */ - if (min_parallelism > max_parallelism) - max_parallelism = min_parallelism; - if(ipoptions && osscan) error("WARNING: Ip options are NOT used while OS scanning!"); Index: osscan2.cc =================================================================== --- osscan2.cc (revision 24749) +++ osscan2.cc (working copy) @@ -3163,7 +3163,13 @@ at least be affected by -T. */ perf.low_cwnd = MAX(o.min_parallelism, 1); perf.max_cwnd = o.max_parallelism? o.max_parallelism : 300; - perf.group_initial_cwnd = box(o.min_parallelism, perf.max_cwnd, 10); + /* Prevent performance values from getting out of whack */ + if (perf.low_cwnd > perf.max_cwnd) { + error( "WARNING: OS scan max_cwnd (%i) would have been below low_cwnd (%i). max_cwnd will be set to %i.", + perf.max_cwnd, perf.low_cwnd, perf.low_cwnd ); + perf.max_cwnd = perf.low_cwnd; + } + perf.group_initial_cwnd = box(perf.low_cwnd, perf.max_cwnd, 10); perf.host_initial_cwnd = perf.group_initial_cwnd; perf.quick_incr = 1; perf.cc_incr = 1; Index: scan_engine.cc =================================================================== --- scan_engine.cc (revision 24749) +++ scan_engine.cc (working copy) @@ -1457,7 +1457,13 @@ at least be affected by -T. */ perf->low_cwnd = MAX(o.min_parallelism, 1); perf->max_cwnd = o.max_parallelism? o.max_parallelism : 300; - perf->group_initial_cwnd = box(o.min_parallelism, perf->max_cwnd, 10); + /* Prevent performance values from getting out of whack */ + if (perf->low_cwnd > perf->max_cwnd) { + error( "WARNING: ultra_scan max_cwnd (%i) would have been below low_cwnd (%i). max_cwnd will be set to %i.", + perf->max_cwnd, perf->low_cwnd, perf->low_cwnd ); + perf->max_cwnd = perf->low_cwnd; + } + perf->group_initial_cwnd = box(perf->low_cwnd, perf->max_cwnd, 10); perf->host_initial_cwnd = perf->group_initial_cwnd; perf->slow_incr = 1; /* The congestion window grows faster with more aggressive timing. */ @@ -5835,6 +5841,13 @@ if (o.min_parallelism) { ss.min_width = o.min_parallelism; } else ss.min_width = 1; + + /* Prevent performance values from getting out of whack */ + if (ss.min_width > ss.max_width) { + error( "WARNING: pos_scan max_width (%i) would have been below min_width (%i). max_width will be set to %i.", + ss.max_width, ss.min_width, ss.min_width ); + ss.max_width = ss.min_width; + } ss.initial_packet_width = box(ss.min_width, ss.max_width, ss.initial_packet_width); ss.numqueries_ideal = ss.initial_packet_width; Index: service_scan.cc =================================================================== --- service_scan.cc (revision 24749) +++ service_scan.cc (working copy) @@ -1705,7 +1705,12 @@ if (o.timing_level == 4) desired_par = 30; if (o.timing_level >= 5) desired_par = 40; // TODO: Come up with better ways to determine ideal_parallelism - ideal_parallelism = box(o.min_parallelism, o.max_parallelism? o.max_parallelism : 100, desired_par); + int min_par = o.min_parallelism; + int max_par = o.max_parallelism? o.max_parallelism : 100; + if ( min_par > max_par ) { + max_par = min_par; + } + ideal_parallelism = box(min_par, max_par, desired_par); } ServiceGroup::~ServiceGroup() {