default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / edit / process / addr_range.html
index 6b05d23..c236a73 100644 (file)
         $cgi->param('end', $end->addr);
         $cgi->param('start', $start->addr);
       }
+      # detect addr ranges that are too big
+      my ($one) = split('\.', $start->addr);
+      if ( $one < 128 and $start + 0x7FFFFFFF <= $end ) {
+        # then this is going to overflow
+        return "Address ranges must be < 2^31 - 1 addresses long.";
+      } # if the first octet is >= 128, then it's in the top half of 
+        # address space and it CAN'T be too big
+
       $cgi->param('length', $end - $start + 1);
     } else {
       $cgi->param('length', 1);