interesting
Tony Bates
Sat May 27 22:29:42 CEST 1995
Daniel Karrenberg <Daniel.Karrenberg at ripe.net> writes: * * > Jessica Yu <jyy at merit.edu> writes: * > I think the problem is that the software allows 198.022.064.0/24 * > and treats it as different IP address, 198.22.64.0/24 ~= 198.022.064.0/ * 24. > I think the software should either * > not allow such ip address (198.022.064.._) or convert it to 198.22.64/2 * 4. * * I believe it should convert. I also believe it did at some point. * We will look into this. * * Daniel Well it converts again now ;-). Here's the patch for this. It requires a patch to net2net.pl and syntax.pl --Tony. *** net2net.pl Sat May 27 16:22:06 1995 --- ../testsrc/src/net2net.pl Sat May 27 16:22:22 1995 *************** *** 145,151 **** "$net_rep is not a classful net representation I understand", @return_rep; } ! @return_rep = (@return_rep, $net_rep."/".$len); return $OK, "", @return_rep; } else { return $NOK, --- 145,152 ---- "$net_rep is not a classful net representation I understand", @return_rep; } ! local($val) = &trimnet($net_rep); ! @return_rep = (@return_rep, $val."/".$len); return $OK, "", @return_rep; } else { return $NOK, *************** *** 165,171 **** local($begin) = &quad2int($oldnet); local($end) = &quad2int($2); if($end < $begin) { ! return $NOK, "range is invalid", @returndtring; } if ($oldnet =~ /(\d+)\.\d+\.\d+\.\d+/) { --- 166,172 ---- local($begin) = &quad2int($oldnet); local($end) = &quad2int($2); if($end < $begin) { ! return $NOK, "range is invalid", @returnstring; } if ($oldnet =~ /(\d+)\.\d+\.\d+\.\d+/) { *************** *** 240,246 **** "based on prefix $usepre", @returnstring; } ! return $OK, "", $net_rep; } else { return $NOK, "$net_rep is not an representation I understand", --- 241,249 ---- "based on prefix $usepre", @returnstring; } ! local($val) = &trimnet($net); ! @returnstring = "$val"."/".$len; ! return $OK, "", @returnstring; } else { return $NOK, "$net_rep is not an representation I understand", *************** *** 373,377 **** --- 376,385 ---- $s=sprintf ("%d.0.0.0", $byte0 ); } return( $s ); + } + + sub trimnet { + local($quad) = @_; + return(&int2quad(&quad2int($quad))); } 1; *** syntax.pl Tue May 23 22:37:14 1995 --- ../testsrc/src/syntax.pl Sat May 27 16:17:19 1995 *************** *** 1533,1538 **** --- 1533,1539 ---- if($stat == $NOK) { return $O_ERROR, "$msg\n"; } + $object{$key} = $str[0]; } return; } -------- Logged at Tue May 30 15:44:31 MET DST 1995 ---------
[ rr-impl Archive ]