Ignore:
Timestamp:
01/18/05 13:13:14 (20 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Re-port temporary hack to "properly" deallocate contiguous-IP
DSL "netblocks". Since the code moved from main.cgi to IPDB.pm,
it isn't a simple patch. :/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/cgi-bin/IPDB.pm

    r125 r126  
    476476      } # end alloctype general case
    477477
     478##TEMP
     479## Temporary wrapper to "properly" deallocate sIP PPPoE/DSL "netblocks" in 209.91.185.0/24
     480## Note that we should really general-case this.
     481my $staticpool = new NetAddr::IP "209.91.185.0/24";
     482##TEMP
     483if ($cidr->within($staticpool)) {
     484##TEMP
     485  # We've already deleted the block, now we have to stuff its IPs into the pool.
     486  $sth = $ip_dbh->prepare("insert into poolips values ('209.91.185.0/24',?,'6750400','Sudbury','d','y',''$
     487  $sth->execute($cidr->addr);
     488  foreach my $ip ($cidr->hostenum) {
     489    $sth->execute("$ip");
     490  }
     491  $cidr--;
     492  $sth->execute($cidr->addr);
     493
     494##TEMP
     495} else {
     496##TEMP
     497
    478498      # Now we look for larger-or-equal-sized free blocks in the same master (routed)
    479499      # (super)block. If there aren't any, we can't combine blocks anyway.  If there
     
    521541      $sth->execute;
    522542
     543##TEMP
     544}
     545##TEMP
     546
    523547      # If we got here, we've succeeded.  Whew!
    524548      $dbh->commit;
Note: See TracChangeset for help on using the changeset viewer.