Changeset 875


Ignore:
Timestamp:
05/13/16 13:36:59 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix subtle bug in _toPool() that caused generated pool IPs to be inserted
without the correct master ID, which broke a surprising number of things.

File:
1 edited

Legend:

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

    r874 r875  
    267267  my $inssth = $dbh->prepare(q{
    268268      INSERT INTO poolips (
    269           ip,type,parent_id,available,
     269          ip,type,parent_id,master_id,available,
    270270          city,description,notes,circuitid,createstamp,modifystamp,privdata,custid,vrf,vlan,rdns
    271271          )
    272       VALUES (?,?,?,'n',?,?,?,?,?,?,?,?,?,?,?)
     272      VALUES (?,?,?,?,'n',?,?,?,?,?,?,?,?,?,?,?)
    273273    });
    274274  my $updsth = $dbh->prepare("UPDATE poolips SET parent_id = ?, type = ? WHERE parent_id = ?");
     
    296296          next if $newip->addr eq $gw->addr;
    297297        }
    298         $inssth->execute($newip, $newtype, $poolparent, @oldalloc) if !$poolcounter{"$newip"};
     298        $inssth->execute($newip, $newtype, $poolparent, $master, @oldalloc) if !$poolcounter{"$newip"};
    299299        $poolcounter{"$newip"}++;
    300300      }
Note: See TracChangeset for help on using the changeset viewer.