Changeset 734 for trunk/cgi-bin


Ignore:
Timestamp:
05/27/15 14:26:30 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix subtle edge-case bug in initPool() where the check for preexisting
net and bcast IPs looked for the wrong thing, and tried to insert them
again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r733 r734  
    15371537  my $msg;
    15381538
    1539   # Trap errors so we can pass them back to the caller.  Even if the
    1540   # caller is only ever supposed to be local, and therefore already
    1541   # trapping errors.  >:(
    1542   local $dbh->{AutoCommit} = 0; # These need to be local so we don't
    1543   local $dbh->{RaiseError} = 1; # step on our toes by accident.
    1544 
    15451539  eval {
    15461540    # have to insert all pool IPs into poolips table as "unallocated".
     
    15891583    if ($class eq 'all') { # (DSL-ish block - *all* IPs available
    15901584      if ($pool->addr !~ /\.0$/) {      # .0 causes weirdness.
    1591         $sth->execute($pool->addr, $pcustid, $city, $type, $parent, $master) unless $foundips{$pool->addr};
     1585        $sth->execute($pool->addr, $pcustid, $city, $type, $parent, $master) unless $foundips{$pool->addr."/32"};
    15921586      }
    15931587      $sth->execute($poolip_list[0]->addr, $pcustid, $city, $type, $parent, $master) unless $foundips{$poolip_list[0]};
    15941588      $pool--;
    15951589      if ($pool->addr !~ /\.255$/) {    # .255 can cause weirdness.
    1596         $sth->execute($pool->addr, $pcustid, $city, $type, $parent, $master) unless $foundips{$pool->addr};
     1590        $sth->execute($pool->addr, $pcustid, $city, $type, $parent, $master) unless $foundips{$pool->addr."/32"};
    15971591      }
    15981592    }
Note: See TracChangeset for help on using the changeset viewer.