Changeset 135 for trunk/klask


Ignore:
Timestamp:
Nov 5, 2013, 11:07:36 AM (10 years ago)
Author:
g7moreau
Message:
  • More severe criteria for ip-free
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r134 r135  
    15491549      for my $ip (@ip_list) {
    15501550
    1551          next LOOP_ON_IP_ADDRESS if
    1552             exists $computerdb->{$ip}
    1553             && $computerdb->{$ip}{timestamp} > $timestamp_barrier;
     1551         if (exists $computerdb->{$ip}) {
     1552            next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{timestamp} > $timestamp_barrier;
     1553           
     1554            my $mac_address = $computerdb->{$ip}{mac_address};
     1555            LOOP_ON_DATABASE:
     1556            foreach my $ip_db (keys %{$computerdb}) {
     1557               next LOOP_ON_DATABASE if $computerdb->{$ip_db}{mac_address} ne $mac_address;
     1558               next LOOP_ON_IP_ADDRESS if $computerdb->{$ip_db}{timestamp} > $timestamp_barrier;
     1559               }
     1560            }
    15541561
    15551562         my $ip_date_last_detection = '';
     
    15611568            }
    15621569
    1563          $result_ip{$ip} ||= {};
    1564          $result_ip{$ip}->{date_last_detection} = $ip_date_last_detection;
    1565 
    15661570         my $packed_ip = scalar gethostbyname($ip);
    15671571         my $hostname_fq = 'unknown';
    15681572            $hostname_fq = scalar gethostbyaddr($packed_ip, AF_INET) || 'unknown' if defined $packed_ip;
     1573
     1574         next LOOP_ON_IP_ADDRESS if $hostname_fq =~ m/$RE_FLOAT_HOSTNAME/;
     1575
     1576         $result_ip{$ip} ||= {};
     1577         $result_ip{$ip}->{date_last_detection} = $ip_date_last_detection;
    15691578         $result_ip{$ip}->{hostname_fq} = $hostname_fq;
    1570 
    15711579         $result_ip{$ip}->{vlan} = $vlan;
    15721580
Note: See TracChangeset for help on using the changeset viewer.