Changeset 404


Ignore:
Timestamp:
05/11/10 18:05:54 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

Merge "temporary" fix-up-the-IP-pool deallocation hack. See #13.

This will be regularized and integrated down the road since it's
likely that legacy data may show the same constructs, and there
are probably advantages to *creating* similar allocations new.

See #6.

File:
1 edited

Legend:

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

    r402 r404  
    704704      } # end alloctype general case
    705705
     706##TEMP
     707## Temporary wrapper to "properly" deallocate sIP PPPoE/DSL "netblocks" in 209.91.185.0/24
     708## Note that we should really general-case this.
     709my $staticpool = new NetAddr::IP "209.91.185.0/24";
     710##TEMP
     711if ($cidr->within($staticpool)) {
     712##TEMP
     713  # We've already deleted the block, now we have to stuff its IPs into the pool.
     714  my $sth2 = $dbh->prepare("insert into poolips values ('209.91.185.0/24',?,'6750400','Sudbury','di','y','','','')");
     715  $sth2->execute($cidr->addr);
     716  foreach my $ip ($cidr->hostenum) {
     717    $sth2->execute("$ip");
     718  }
     719  $cidr--;
     720  $sth2->execute($cidr->addr);
     721
     722##TEMP
     723} else {
     724##TEMP
     725
    706726      # Now we look for larger-or-equal-sized free blocks in the same master (routed)
    707727      # (super)block. If there aren't any, we can't combine blocks anyway.  If there
     
    751771      }
    752772      $sth->execute;
     773
     774##TEMP
     775}
     776##TEMP
    753777
    754778      # If we got here, we've succeeded.  Whew!
Note: See TracChangeset for help on using the changeset viewer.