Changeset 559 for trunk/cgi-bin
- Timestamp:
- 12/19/12 15:27:02 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r558 r559 1119 1119 # 'Net don't work like that, homey. Restrict VRF-uniqueness to private IPs? 1120 1120 # -> $isprivnet flag from start of sub 1121 1122 # if the block to be deleted is a container, move its freeblock(s) up a level, and reset their parenting info1123 if ($binfo->{type} =~ /^.[mc]/) {1124 # move the freeblocks into the parent1125 # we don't insert a new freeblock because there could be a live reparented sub.1126 $dbh->do("UPDATE freeblocks SET rdepth=rdepth-1,parent=?,routed=?,city=? ".1127 "WHERE parent=? AND rdepth=?", undef,1128 ($parent, $ptype, $pcity, $cidr, $rdepth+1) );1129 } else {1130 # ... otherwise, add the freeblock1131 $dbh->do("INSERT INTO freeblocks (cidr, city, routed, parent, rdepth) VALUES (?,?,?,?,?)", undef,1132 ($cidr, $pcity, $ptype, $parent, $rdepth) );1133 }1134 1121 1135 1122 my $fbrdepth = $rdepth; … … 1196 1183 # freeblocks in the identified parent to see if we can combine any of them. 1197 1184 1185 # if the block to be deleted is a container, move its freeblock(s) up a level, and reset their parenting info 1186 if ($binfo->{type} =~ /^.[mc]/) { 1187 # move the freeblocks into the parent 1188 # we don't insert a new freeblock because there could be a live reparented sub. 1189 $dbh->do("UPDATE freeblocks SET rdepth=rdepth-1,parent=?,routed=?,city=? ". 1190 "WHERE parent=? AND rdepth=?", undef, 1191 ($parent, $ptype, $pcity, $cidr, $rdepth+1) ); 1192 } else { 1193 # ... otherwise, add the freeblock 1194 $dbh->do("INSERT INTO freeblocks (cidr, city, routed, parent, rdepth) VALUES (?,?,?,?,?)", undef, 1195 ($cidr, $pcity, $ptype, $parent, $rdepth) ); 1196 } 1197 1198 1198 ##fixme: vrf 1199 1199 # set up the query to get the list of blocks to try to merge.
Note:
See TracChangeset
for help on using the changeset viewer.