diff --git a/Changes b/Changes index 736782d..703fcfd 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,16 @@ Revision history for Perl extension NetAddr::IP +4.007 Wed Jun 6 16:41:11 VET 2007 + Update copyright dates + Wed Jun 6 21:50:20 VET 2007 + Added patch from Daryl O'Shea to remove remaining $`. Thanks Daryl. + +4.006 Wed Jun 6 15:58:04 VET 2007 + + A patch from Michael got rid of $& and $` as reported by Daryl + O'Shea and documented at + http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5312 + 4.004 Wed Aug 16 16:01:54 PDT 2006 update to include/exclude files in corrupted distro diff --git a/IP.pm b/IP.pm index b59b9ad..52c7777 100644 --- a/IP.pm +++ b/IP.pm @@ -31,7 +31,7 @@ @ISA = qw(Exporter NetAddr::IP::Lite); -$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.4 $ =~ /\d+/g) }; +$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.7 $ =~ /\d+/g) }; =pod @@ -1011,16 +1011,16 @@ my @grp; do { my $grp = join('',splice(@dig,0,4)); - if ($grp =~ /^0+/) { - my $l = length($&); + if ($grp =~ /^(0+)/) { + my $l = length($1); if ($l == 4) { $grp = '0{1,4}'; } else { - $grp =~ s/^${&}/0\{0,$l\}/; + $grp =~ s/^${1}/0\{0,$l\}/; } } - if ($grp =~ /x+$/) { - my $l = length($&); + if ($grp =~ /(x+)$/) { + my $l = length($1); if ($l == 4) { $grp = '[0-9a-fA-F]{1,4}'; } else { @@ -1059,7 +1059,7 @@ =head1 HISTORY -$Id: IP.pm,v 4.4 2006/08/17 01:00:54 lem Exp $ +$Id: IP.pm,v 4.7 2007/06/06 20:43:38 luisemunoz Exp $ =over @@ -1695,7 +1695,7 @@ =head1 AUTHORS -Luis E. Mu�oz Eluismunoz@cpan.orgE, +Luis E. Muñoz Eluismunoz@cpan.orgE, Michael Robinton Emichael@bizsystems.comE =head1 WARRANTY @@ -1705,18 +1705,15 @@ =head1 LICENSE -This software is (c) Luis E. Mu�oz, 1999 - 2005, and (c) Michael Robinton, 2006. -It can be used under the terms of the perl artistic license provided that -proper credit for the work of the author is preserved in the form of this -copyright notice and license for this module. +This software is (c) Luis E. Muñoz, 1999 - 2007, and (c) Michael +Robinton, 2006 - 2007. It can be used under the terms of the Perl +artistic license provided that proper credit for the work of the +authors is preserved in the form of this copyright notice and license +for this module. =head1 SEE ALSO - perl(1) - - L - - L + perl(1),NetAddr::IP::Lite, NetAddr::IP::Util. =cut diff --git a/Lite/Util/README b/Lite/Util/README index b58afe3..da46183 100644 --- a/Lite/Util/README +++ b/Lite/Util/README @@ -429,7 +429,7 @@ us. COPYRIGHT - Copyright 2003 - 2006, Michael Robinton + Copyright 2003 - 2007, Michael Robinton LICENSE AND WARRANTY diff --git a/Lite/Util/Util.pm b/Lite/Util/Util.pm index 5658d03..48122df 100644 --- a/Lite/Util/Util.pm +++ b/Lite/Util/Util.pm @@ -13,7 +13,7 @@ @ISA = qw(Exporter DynaLoader); -$VERSION = do { my @r = (q$Revision: 1.3 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +$VERSION = do { my @r = (q$Revision: 1.5 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; my @export_ok = qw( inet_aton @@ -263,9 +263,9 @@ sub ipv6_aton { my($ipv6) = @_; return undef unless $ipv6; - if ($ipv6 =~ /:(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) { # mixed hex, dot-quad - return undef if $1 > 255 || $2 > 255 || $3 > 255 || $4 > 255; - $ipv6 = sprintf("%s:%X%02X:%X%02X",$`,$1,$2,$3,$4); # convert to pure hex + if ($ipv6 =~ /^(.*):(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) { # mixed hex, dot-quad + return undef if $2 > 255 || $3 > 255 || $4 > 255 || $5 > 255; + $ipv6 = sprintf("%s:%X%02X:%X%02X",$1,$2,$3,$4,$5); # convert to pure hex } my $c; return undef if @@ -387,8 +387,8 @@ sub inet_n2dx($) { my($nadr) = @_; if (isIPv4($nadr)) { - ipv6_n2d($nadr) =~ /[^:]+$/; - return $&; + ipv6_n2d($nadr) =~ /([^:]+)$/; + return $1; } return ipv6_n2x($nadr); } @@ -408,8 +408,8 @@ my($nadr) = @_; my $addr = ipv6_n2d($nadr); return $addr unless isIPv4($nadr); - $addr =~ /[^:]+$/; - return $&; + $addr =~ /([^:]+)$/; + return $1; } =item * $ipv6naddr = ipv4to6($netaddr); @@ -710,7 +710,7 @@ =head1 COPYRIGHT -Copyright 2003 - 2006, Michael Robinton Emichael@bizsystems.comE +Copyright 2003 - 2007, Michael Robinton Emichael@bizsystems.comE LICENSE AND WARRANTY diff --git a/Lite/Util/Util.xs b/Lite/Util/Util.xs index 0313b53..023df45 100644 --- a/Lite/Util/Util.xs +++ b/Lite/Util/Util.xs @@ -437,7 +437,7 @@ STRLEN len; int i; PPCODE: - ap = SvPV(s,len); + ap = (unsigned char *) SvPV(s,len); if (len != 16) { if (ix == 2) strcpy((char *)wa,"ipv6to4"); @@ -449,7 +449,7 @@ "NetAddr::IP::Util::",(char *)wa,len *8,128); } if (ix == 2) { - XPUSHs(sv_2mortal(newSVpvn((unsigned char *)(ap +12),4))); + XPUSHs(sv_2mortal(newSVpvn((char *)(ap +12),4))); XSRETURN(1); } else if (ix == 1) { @@ -476,7 +476,7 @@ memcpy(wa,ap,16); fastcomp128(wa); } - XPUSHs(sv_2mortal(newSVpvn((unsigned char *)wa,16))); + XPUSHs(sv_2mortal(newSVpvn((char *)wa,16))); XSRETURN(1); void @@ -489,7 +489,7 @@ unsigned char * ap, *bp; STRLEN len; PPCODE: - ap = SvPV(as,len); + ap = (unsigned char *) SvPV(as,len); if (len != 16) { Bail: if (ix == 1) @@ -500,7 +500,7 @@ "NetAddr::IP::Util::",(char *)wa,len *8,128); } - bp = SvPV(bs,len); + bp = (unsigned char *) SvPV(bs,len); if (len != 16) { goto Bail; } @@ -516,7 +516,7 @@ } if (GIMME_V == G_ARRAY) { netswap(a128.u,4); - XPUSHs(sv_2mortal(newSVpvn(a128.c,16))); + XPUSHs(sv_2mortal(newSVpvn((char *)a128.c,16))); XSRETURN(2); } XSRETURN(1); @@ -529,7 +529,7 @@ unsigned char * ap; STRLEN len; PPCODE: - ap = SvPV(s,len); + ap = (unsigned char *) SvPV(s,len); if (len != 16) { croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::addconst",len *8,128); @@ -538,7 +538,7 @@ XPUSHs(sv_2mortal(newSViv((I32)addercon(wa,cnst)))); if (GIMME_V == G_ARRAY) { netswap(a128.u,4); - XPUSHs(sv_2mortal(newSVpvn(a128.c,16))); + XPUSHs(sv_2mortal(newSVpvn((char *)a128.c,16))); XSRETURN(2); } XSRETURN(1); @@ -552,7 +552,7 @@ unsigned char * bp; STRLEN len; CODE: - bp = SvPV(s,len); + bp = (unsigned char *) SvPV(s,len); if (len != 16) { if (ix == 1) strcpy((char *)wa,"isIPv4"); @@ -580,28 +580,28 @@ unsigned char * cp; STRLEN len; PPCODE: - cp = SvPV(s,len); + cp = (unsigned char *) SvPV(s,len); if (ix == 0) { if (len != 16) { croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::bin2bcd",len *8,128); } (void) _bin2bcd(cp); - XPUSHs(sv_2mortal(newSVpvn(n.txt,_bcd2txt((unsigned char *)n.bcd)))); + XPUSHs(sv_2mortal(newSVpvn((char *)n.txt,_bcd2txt((unsigned char *)n.bcd)))); } else if (ix == 1) { if (len != 16) { croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::bin2bcdn",len *8,128); } - XPUSHs(sv_2mortal(newSVpvn((unsigned char *)n.bcd,_bin2bcd(cp)))); + XPUSHs(sv_2mortal(newSVpvn((char *)n.bcd,_bin2bcd(cp)))); } else { if (len > 20) { croak("Bad arg length for %s, length is %d, should %d digits or less", "NetAddr::IP::Util::bcdn2txt",len *2,40); } - XPUSHs(sv_2mortal(newSVpvn(n.txt,_bcd2txt(cp)))); + XPUSHs(sv_2mortal(newSVpvn((char *)n.txt,_bcd2txt(cp)))); } XSRETURN(1); @@ -621,7 +621,7 @@ unsigned char * cp, badc; STRLEN len; PPCODE: - cp = SvPV(s,len); + cp = (unsigned char *) SvPV(s,len); if (len > 40) { if (ix == 0) strcpy((char *)wa,"bcd2bin"); @@ -644,7 +644,7 @@ len = SvIV(ST(1)); _bcdn2bin(cp,(int)len); netswap(a128.u,4); - XPUSHs(sv_2mortal(newSVpvn(a128.c,16))); + XPUSHs(sv_2mortal(newSVpvn((char *)a128.c,16))); XSRETURN(1); } @@ -660,10 +660,10 @@ if (ix == 0) { _bcdn2bin(n.bcd,40); netswap(a128.u,4); - XPUSHs(sv_2mortal(newSVpvn(a128.c,16))); + XPUSHs(sv_2mortal(newSVpvn((char *)a128.c,16))); } else { /* ix == 1 */ - XPUSHs(sv_2mortal(newSVpvn((unsigned char *)n.bcd,20))); + XPUSHs(sv_2mortal(newSVpvn((char *)n.bcd,20))); } XSRETURN(1); @@ -674,7 +674,7 @@ unsigned char * ap, count; STRLEN len; PPCODE: - ap = SvPV(s,len); + ap = (unsigned char *) SvPV(s,len); if (len != 16) { croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::countbits",len *8,128); @@ -697,7 +697,7 @@ unsigned char * ip; STRLEN len; PPCODE: - ip = SvPV(s,len); + ip = (unsigned char *) SvPV(s,len); if (len != 4) { if (ix == 1) strcpy((char *)wa,"mask4to6"); @@ -710,7 +710,7 @@ extendipv4(ip); else extendmask4(ip); - XPUSHs(sv_2mortal(newSVpvn((unsigned char *)wa,16))); + XPUSHs(sv_2mortal(newSVpvn((char *)wa,16))); XSRETURN(1); void @@ -722,15 +722,15 @@ unsigned char * ip; STRLEN len; PPCODE: - ip = SvPV(s,len); + ip = (unsigned char *) SvPV(s,len); if (len == 16) /* if already 128 bits, return input */ - XPUSHs(sv_2mortal(newSVpvn(ip,16))); + XPUSHs(sv_2mortal(newSVpvn((char *)ip,16))); else if (len == 4) { if (ix == 0) extendipv4(ip); else extendmask4(ip); - XPUSHs(sv_2mortal(newSVpvn((unsigned char *)wa,16))); + XPUSHs(sv_2mortal(newSVpvn((char *)wa,16))); } else { if (ix == 1) diff --git a/Lite/Util/lib/NetAddr/IP/UtilPP.pm b/Lite/Util/lib/NetAddr/IP/UtilPP.pm index 388b7de..d661a0a 100644 --- a/Lite/Util/lib/NetAddr/IP/UtilPP.pm +++ b/Lite/Util/lib/NetAddr/IP/UtilPP.pm @@ -12,7 +12,7 @@ @ISA = qw(Exporter); -$VERSION = do { my @r = (q$Revision: 1.2 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +$VERSION = do { my @r = (q$Revision: 1.4 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; @EXPORT_OK = qw( hasbits @@ -626,8 +626,8 @@ my $len = length($bcd); die "Bad bcd number length $_ ".__PACKAGE__.":simple_pack, should be 1 to 40 digits" if $len > 40 || $len < 1; - die "Bad character in decimal input string '$&' for ".__PACKAGE__.":simple_pack" - if $bcd =~ /\D/; + die "Bad character in decimal input string '$1' for ".__PACKAGE__.":simple_pack" + if $bcd =~ /(\D)/; } sub simple_pack { @@ -668,7 +668,7 @@ =head1 COPYRIGHT -Copyright 2006, Michael Robinton +Copyright 2006 - 2007, Michael Robinton This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (except as noted diff --git a/MANIFEST b/MANIFEST index f282cb2..0545e59 100644 --- a/MANIFEST +++ b/MANIFEST @@ -94,7 +94,6 @@ Makefile.PL MANIFEST This list of files MANIFEST.SKIP -META.yml README t/imhoff.t t/loops.t @@ -118,3 +117,4 @@ t/v6-split-bulk.t t/wildcard.t TODO +META.yml Module meta-data (added by MakeMaker) diff --git a/META.yml b/META.yml index 6fa6318..7c8eb84 100644 --- a/META.yml +++ b/META.yml @@ -1,11 +1,11 @@ # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: NetAddr-IP -version: 4.004 +version: 4.007 version_from: IP.pm installdirs: site requires: Test::More: 0 distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.17 +generated_by: ExtUtils::MakeMaker version 6.30