Package: libnet-ip-perl
Version: 1.25-1
Severity: normal
Tags: patch

Hi,

The 'ipcount' script (/usr/share/doc/libnet-ip-perl/examples/ipcount) is
really useful, but the -d option results in a fatal error :

$ ipcount -d 24 192.68.0.0/23
Invalid chars in IP 192.68.0.0+255 at /home/tom/bin/ipcount line 83.

The attached (very simple) patch fixes it :

$ ipcount2 -d 24 192.68.0.0/23
192.68.0/24
192.68.1/24

Found 2 /24s in 192.68.0/23

Regards,
Tom

-- 
Thomas Parmelan
--- ipcount     2006-08-05 02:03:14.000000000 +0200
+++ ipcount2    2006-11-10 15:06:08.000000000 +0100
@@ -80,7 +80,7 @@
        
        while ($current->bincomp ('lt', $last))
        {
-               $new_ip->set($current->last_ip.'+'.$size) or die (Error());
+               $new_ip->set($current->last_ip.' + '.$size) or die (Error());
                print $new_ip->print,"\n";
                
                if ($opts{r})
@@ -88,7 +88,7 @@
                        print $new_ip->reverse_ip,"\n";
                }
                
-               $current->set($new_ip->last_ip .'+ 1') or die (Error());
+               $current->set($new_ip->last_ip .' + 1') or die (Error());
                
                $count++;
        }

Reply via email to