File: 02_abbrev.diff

package info (click to toggle)
libnet-cidr-perl 0.25-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 156 kB
  • sloc: perl: 712; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 616 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Description: add support for abbreviated cidr addresses
 This issue was deemed "not a bug" by upstream, so the patch was not
 accepted
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=22373
Author: Bart Martens <bartm@debian.org>
Reviewed-by: Nick Morrott <knowledgejunkie@gmail.com>
Last-Update: 2021-04-11

--- a/lib/Net/CIDR.pm
+++ b/lib/Net/CIDR.pm
@@ -440,6 +440,7 @@
     ($isipv6, $ip)=_ipv6to4($iparg);
 
     my @ips= split (/\.+/, $ip);
+    for( my $i = $#ips + 1 ; $i < 4 ; $i++ ) { $ips[$i] = 0; }
 
     grep {
 	croak "$_, in $iparg, is not a byte" unless $_ >= 0 && $_ <= 255 && $_ =~ /^[0-9]+$/;