Changeset 764 for trunk/cgi-bin
- Timestamp:
- 07/30/15 16:59:30 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r759 r764 1762 1762 $sql .= join " = ?, ", @fieldlist; 1763 1763 1764 # create these here so we can use the expanded CIDR in the rDNS update after the eval, 1765 # if we're expanding the block into a "reserved" freeblock 1766 my $cidr = NetAddr::IP->new($binfo->{block}); 1767 my $newblock = NetAddr::IP->new($cidr->addr, $cidr->masklen - 1)->network; 1768 1764 1769 eval { 1765 1770 # check for block merge first... 1766 1771 if ($args{fbmerge}) { 1767 my $cidr = NetAddr::IP->new($binfo->{block});1768 my $newblock = NetAddr::IP->new($cidr->addr, $cidr->masklen - 1)->network;1769 1772 # safety net? make sure mergeable block passed in is really one or both of 1770 1773 # a) reserved for expansion of the block and … … 1842 1845 # and the per-IP set, if there is one. 1843 1846 _rpc('updateRevSet', %{$args{iprev}}, rpcuser => $args{user}) if keys (%{$args{iprev}}); 1847 1848 # and fix up the template's CIDR if required 1849 _rpc('resizeTemplate', oldcidr => "$binfo->{block}", newcidr => $newblock->network.'', rpcuser => $args{user}) 1850 if $args{fbmerge}; 1844 1851 } 1845 1852 … … 1997 2004 } # for (... @newblocks) 1998 2005 1999 $dbh->do("DELETE FROM freeblocks WHERE id IN (".join(',', keys %fbdel).")") ;2006 $dbh->do("DELETE FROM freeblocks WHERE id IN (".join(',', keys %fbdel).")") if %fbdel; 2000 2007 2001 2008 $dbh->commit;
Note:
See TracChangeset
for help on using the changeset viewer.