Changeset 429


Ignore:
Timestamp:
Jul 11, 2010, 11:07:28 AM (11 years ago)
Author:
Kris Deugau
Message:

/trunk

Generalize deallocation of netblocks within a static-IP pool. Still
needs to be tweaked to correctly handle non-PPP pools. (PPP only
requires that .0 and .255 not be handed out, no matter what the CIDR
boundaries; standard netblocks have a network number, gateway, and
broadcast IP that can't be used on any size block.) See #6.

File:
1 edited

Legend:

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

    r428 r429  
    721721      } # end alloctype general case
    722722
    723       ## Deallocate legacy blocks stashed in the middle of a DSL static IP pool
     723      ## Deallocate legacy blocks stashed in the middle of a static IP pool
    724724      ## This may be expandable to an even more general case of contained netblock, or other pool types.
    725725
     
    734734        $sth2 = $dbh->prepare("INSERT INTO poolips (pool,ip,city,type,custid) values ".
    735735                "('$pool',?,'$poolcity','$pooltype','$defcustid')");
     736##fixme:  need to not insert net, gateway, and bcast on "real netblock" pools (DHCPish)
    736737        # don't insert .0
    737 ##fixme:  need to not insert .1 on "real netblock" pools (DHCPish)
    738738        $sth2->execute($cidr->addr) unless $cidr->addr =~ m|\.0$|;
    739739        foreach my $ip ($cidr->hostenum) {
     
    795795      } # done returning IPs to the appropriate place
    796796
    797 die "blah, missed the case\n";
    798797      # If we got here, we've succeeded.  Whew!
    799798      $dbh->commit;
Note: See TracChangeset for help on using the changeset viewer.