Index: trunk/cgi-bin/IPDB.pm
===================================================================
--- trunk/cgi-bin/IPDB.pm	(revision 671)
+++ trunk/cgi-bin/IPDB.pm	(revision 674)
@@ -99,4 +99,8 @@
 our $revgroup = 1;	# should probably be configurable somewhere
 our $rpccount = 0;
+
+# Largest inverse CIDR mask length to show per-IP rDNS list
+# (eg, NetAddr::IP->bits - NetAddr::IP->masklen)
+our $maxrevlist = 5;  # /27
 
 ##
Index: trunk/cgi-bin/MyIPDB.pm
===================================================================
--- trunk/cgi-bin/MyIPDB.pm	(revision 671)
+++ trunk/cgi-bin/MyIPDB.pm	(revision 674)
@@ -72,4 +72,9 @@
 #$IPDB::rpc_url = 'http://dnsadmin.example.com/dns-rpc.cgi';
 
+# Largest inverse CIDR mask length to show per-IP rDNS list
+# (eg, NetAddr::IP->bits - NetAddr::IP->masklen)
+# allowing longer than a /27 is probably going to slow things down;  longer than /29 will scroll.
+#$IPDB::maxrevlist = 8;  # v4 /24
+
 ## connectDB_My()
 # Wrapper for IPDB::connectDB
Index: trunk/cgi-bin/main.cgi
===================================================================
--- trunk/cgi-bin/main.cgi	(revision 671)
+++ trunk/cgi-bin/main.cgi	(revision 674)
@@ -462,4 +462,26 @@
     } # check for freeblocks assignment or IPDB-controlled assignment
 
+    # Generate the IP list for the new allocation in case someone wants to set per-IP rDNS right away.
+    # We don't do this on the previous page because we don't know how big a block or even what IP range
+    # it's for (if following the "normal" allocation process)
+    if ($IPDBacl{$authuser} =~ /c/
+	&& $cidr->masklen != $cidr->bits
+	&& ($cidr->bits - $cidr->masklen) <= $IPDB::maxrevlist
+	&& $webvar{alloctype} !~ /^.[dpi]/
+	# do we want to allow v6 at all?
+	#&& ! $cidr->{isv6}
+	) {
+      my @list;
+      foreach my $ip (@{$cidr->splitref()}) {
+        my %row;
+        $row{r_ip} = $ip->addr;
+        $row{iphost} = '';
+        push @list, \%row;
+      }
+      $page->param(r_iplist => \@list);
+      # We don't use this here, because these IPs should already be bare.
+      # ... or should we be paranoid?  Make it a config option?
+      #getRDNSbyIP($ip_dbh, type => $webvar{alloctype}, range => "$cidr", user => $authuser) );
+    }
   } # if ($webvar{alloctype} =~ /^.i$/)
 
