Changeset 616 for branches/stable/cgi-bin
- Timestamp:
- 10/24/13 10:30:15 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/IPDB.pm
r612 r616 1287 1287 my $poolip = 0; 1288 1288 1289 my $binfo; 1290 ## hack ptui 1291 # the current DB does not lend itself well to /32 netblock allocations. 1292 # this hack should work around that lack so that such allocations can be manipulated: 1293 # instead of inspecting $block/$cidr to see if it's an IPv4 /32, 1294 # we brute-force it and just see if there's anything in the allocations 1295 # table first, then if nothing was found check the poolips table 1296 $binfo = $dbh->selectrow_hashref("SELECT $keycol AS block, custid, type, city, circuitid, description,". 1297 " notes, modifystamp AS lastmod, privdata, vrf".($poolip ? '' : ', swip')." FROM $blocktable". 1298 " WHERE $keycol = ?", undef, ($block) ); 1299 1300 ## this only works if blocks are never /32. *sigh* 1289 1301 # Pool IP and IPv6 check all in one! Still needs to be tightened 1290 1302 # up a little for the as-yet-unhandled case of IPv6 IP pools 1291 if ($cidr->bits == 32 && $cidr->masklen == 32) { 1303 # if ($cidr->bits == 32 && $cidr->masklen == 32) { 1304 if (!$binfo) { 1292 1305 $poolip = 1; 1293 1306 $keycol = 'ip'; 1294 1307 $blocktable = 'poolips'; 1295 } 1296 my $binfo = $dbh->selectrow_hashref("SELECT $keycol AS block, custid, type, city, circuitid, description,". 1308 $binfo = $dbh->selectrow_hashref("SELECT $keycol AS block, custid, type, city, circuitid, description,". 1297 1309 " notes, modifystamp AS lastmod, privdata, vrf".($poolip ? '' : ', swip')." FROM $blocktable". 1298 1310 " WHERE $keycol = ?", undef, ($block) ); 1311 } 1299 1312 return $binfo; 1300 1313 } # end getBlockData()
Note:
See TracChangeset
for help on using the changeset viewer.