X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Faddr_range.html;h=c236a7353c6cf039929e24f38906569e29298809;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hp=6b05d23a51468a5d6bf4a7963d8fc109df7662ff;hpb=430b2c784d2ee9ea5be00b821d2dbd27279ef132;p=freeside.git diff --git a/httemplate/edit/process/addr_range.html b/httemplate/edit/process/addr_range.html index 6b05d23a5..c236a7353 100644 --- a/httemplate/edit/process/addr_range.html +++ b/httemplate/edit/process/addr_range.html @@ -13,6 +13,14 @@ $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);