Changeset 354


Ignore:
Timestamp:
Sep 14, 2018, 9:36:53 AM (6 years ago)
Author:
g7moreau
Message:
  • Small bug in IP range check
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ddt/ddt

    r353 r354  
    2121use strict;
    2222#use warnings;
    23 use version; our $VERSION = version->declare('0.11.5');
     23use version; our $VERSION = version->declare('0.11.6');
    2424
    2525use Getopt::Long qw(GetOptions);
     
    321321   my $cidr = shift;
    322322
    323    return 1 if $cidr !~ m{^(\d+\.){3}\d+/\d+$};
    324    return 1 if not NetAddr::IP->new($cidr);
    325    return 0;
     323   return 0 if $cidr !~ m{^(\d+\.){3}\d+/\d+$};
     324   return 0 if not NetAddr::IP->new($cidr);
     325   return 1;
    326326   }
    327327
     
    16691669
    16701670   my $timestamp = time;
    1671    $computer_db->{'dset'}{$sector}{'ip-range'} |= [];
     1671   $computer_db->{'dset'}{$sector}{'ip-range'} ||= [];
    16721672   LOOP_ON_CIDR:
    16731673   for my $cidr_current (@{$computer_db->{'dset'}{$sector}{'ip-range'}}) {
Note: See TracChangeset for help on using the changeset viewer.