Changeset 722 for trunk/cgi-bin


Ignore:
Timestamp:
05/20/15 13:53:31 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix minor bugs in _compactFree() that would only affect guided allocation

  • set the now-misnamed "routed" field correctly
  • set the VRF to match the parent
File:
1 edited

Legend:

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

    r721 r722  
    155155sub _compactFree {
    156156  my $dbh = shift;
    157 
    158157  my $parent = shift;
    159158
    160159  # Rather than having the caller provide all the details
    161160  my $pinfo = getBlockData($dbh, $parent);
    162   my $ftype = (split //, $pinfo->{type})[1];
     161  my $ftype = (split //, $pinfo->{type})[0];
    163162
    164163# NetAddr::IP->compact() attempts to produce the smallest inclusive block
     
    201200
    202201  # now we walk the new list of compacted blocks, and see which ones we need to insert
    203   $sth = $dbh->prepare("INSERT INTO freeblocks (cidr,city,routed,parent_id,master_id) VALUES (?,?,?,?,?)");
     202  $sth = $dbh->prepare("INSERT INTO freeblocks (cidr,city,routed,vrf,parent_id,master_id) VALUES (?,?,?,?,?)");
    204203  foreach my $cme (@combinelist) {
    205204    next if grep { $cme == $_ } @rawfb; # skip if the combined block was in the raw list
    206     $sth->execute($cme, $pinfo->{city}, $ftype, $parent, $pinfo->{master_id});
     205    $sth->execute($cme, $pinfo->{city}, $ftype, $pinfo->{vrf}, $parent, $pinfo->{master_id});
    207206  }
    208207
Note: See TracChangeset for help on using the changeset viewer.