undo changes, maintain classic ATF calculation

This commit is contained in:
fbsanchez 2020-04-13 17:50:18 +02:00
parent cf67dda2eb
commit 1057f76e5e
1 changed files with 14 additions and 15 deletions

View File

@ -1887,17 +1887,15 @@ sub scan($) {
# Delete previous connections. # Delete previous connections.
$self->call('delete_connections'); $self->call('delete_connections');
# Connect hosts that are still unconnected using known gateways. # Connectivity from address forwarding tables.
$self->call('message', "[2/6] Finding host to gateway connectivity.", 3); $self->call('message', "[2/6] Finding address forwarding table connectivity...", 3);
$self->{'c_network_name'} = ''; $self->{'c_network_name'} = '';
$self->{'step'} = STEP_GATEWAY; $self->{'step'} = STEP_AFT;
($progress, $step) = (50, 10.0 / scalar(@hosts)); # From 70% to 80%. ($progress, $step) = (50, 10.0 / scalar(@hosts)); # From 50% to 60%.
$self->get_routes(); # Update the route cache. for (my $i = 0; defined($hosts[$i]); $i++) {
foreach my $host (@hosts) {
$self->call('update_progress', $progress); $self->call('update_progress', $progress);
$progress += $step; $progress += $step;
next if ($self->has_parent($host)); $self->aft_connectivity($hosts[$i]);
$self->gateway_connectivity($host);
} }
# Connect hosts that are still unconnected using traceroute. # Connect hosts that are still unconnected using traceroute.
@ -1912,17 +1910,18 @@ sub scan($) {
$self->traceroute_connectivity($host); $self->traceroute_connectivity($host);
} }
# Connectivity from address forwarding tables. # Connect hosts that are still unconnected using known gateways.
$self->call('message', "[4/6] Finding address forwarding table connectivity...", 3); $self->call('message', "[4/6] Finding host to gateway connectivity.", 3);
$self->{'c_network_name'} = ''; $self->{'c_network_name'} = '';
$self->{'step'} = STEP_AFT; $self->{'step'} = STEP_GATEWAY;
($progress, $step) = (70, 10.0 / scalar(@hosts)); # From 50% to 60%. ($progress, $step) = (70, 10.0 / scalar(@hosts)); # From 70% to 80%.
for (my $i = 0; defined($hosts[$i]); $i++) { $self->get_routes(); # Update the route cache.
foreach my $host (@hosts) {
$self->call('update_progress', $progress); $self->call('update_progress', $progress);
$progress += $step; $progress += $step;
$self->aft_connectivity($hosts[$i]); next if ($self->has_parent($host));
$self->gateway_connectivity($host);
} }
} }
# Apply monitoring templates # Apply monitoring templates