Subject: | findNetblock produces warnings with strings not being ip addresses |
Hi,
If I feed something to findNetblock which is not an ip address I get a
warning or more than one. This is filling our error log.
I could check if the parameter is an ip address but as ipquad() in your
module does it too, it would be double work.
Here is an example:
perl -wle'use Net::Netmask;
my $ip = "127.0.0.";
my $block = findNetblock($ip, {1 => []});'
Use of uninitialized value $ip in bitwise and (&) at /home/perl/lib/Net/
Netmask.pm line 303.
Use of uninitialized value $ip in bitwise and (&) at /home/perl/lib/Net/
Netmask.pm line 303.
[message repeated a number of times]
So in findNetblock() it would be best to just return if ipquad()
returns undef. What do you think? Like this:
sub findNetblock
{
my ($ipquad, $t) = @_;
$t = $remembered unless $t;
my $ip = quad2int($ipquad);
return unless defined $ip;
regards,
tina