Index: branches/stable/cgi-bin/main.cgi
===================================================================
--- branches/stable/cgi-bin/main.cgi	(revision 163)
+++ branches/stable/cgi-bin/main.cgi	(revision 164)
@@ -800,8 +800,8 @@
     if ($base =~ /^[ds]$/) {
       $sql = "select * from poolips where available='y' and".
-	" ptype='$base' and (city='Sudbury' or city='North Bay')";
+	" type='$webvar{alloctype}' and (city='Sudbury' or city='North Bay')";
     } else {
       $sql = "select * from poolips where available='y' and".
-	" ptype='$base' and city='$webvar{pop}'";
+	" type='$webvar{alloctype}' and city='$webvar{pop}'";
     }
 
