Changeset 189 for trunk


Ignore:
Timestamp:
Nov 11, 2016, 12:24:37 PM (8 years ago)
Author:
g7moreau
Message:
  • Small error on loop
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r188 r189  
    12041204
    12051205   if ($repairdns) { # Search and update unkown computer in reverse DNS
    1206       LOOP_ON_COMPUTER:
    1207       for my $one_computer (@computer) {
    1208          next LOOP_ON_COMPUTER if $computerdb->{$one_computer}{hostname_fq} ne 'unknow';
    1209 
    1210          my $packed_ip = scalar gethostbyname($one_computer);
    1211          next LOOP_ON_COMPUTER if not defined $packed_ip;
     1206      LOOP_ON_IP_ADDRESS:
     1207      for my $ip (keys %{$computerdb}) {
     1208         next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{hostname_fq} ne 'unknow';
     1209
     1210         my $packed_ip = scalar gethostbyname($ip);
     1211         next LOOP_ON_IP_ADDRESS if not defined $packed_ip;
    12121212
    12131213         my $hostname_fq = scalar gethostbyaddr($packed_ip, AF_INET);
    1214          next LOOP_ON_COMPUTER if not defined $hostname_fq;
    1215 
    1216          $computerdb->{$one_computer}{hostname_fq} = $hostname_fq;
     1214         next LOOP_ON_IP_ADDRESS if not defined $hostname_fq;
     1215
     1216         $computerdb->{$ip}{hostname_fq} = $hostname_fq;
    12171217         $database_has_changed++;
    12181218         }
Note: See TracChangeset for help on using the changeset viewer.