Skip Menu |

This queue is for tickets about the Net-IP CPAN distribution.

Report information
The Basics
Id: 62925
Status: stalled
Priority: 0/
Queue: Net-IP

People
Owner: cpan [...] bat.ru
Requestors: JEB [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.25
Fixed in: (no value)



Subject: get_embedded_ipv4
I suspect the get_embedded_ipv4() method doesn't honour the extraction of embeded IPv4 addresses according to the format specified at http://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses, where by IPv6 addresses can be represented by "::ffff:1.2.3.4" This version seems to return embedded IPv4s from IPv6 addresses: sub get_embeddded_ipv6 { my $ipv6 = shift; my @parts = split /:/, $ipv6; for (0..4) { return unless defined($parts[$_]) && $parts[$_] eq "0000"; } return unless defined($parts[$5]) && $parts[5] eq "ffff"; return unless defined($parts[6]) && defined($parts[7]); my $ipv4 = join('.', unpack ('C4', pack('H*', $parts[6]. $parts[7]))); return $ipv4 if ip_is_ipv4($ipv4); }
Current version is quiet simple, but: print ip_get_embedded_ipv4('::ffff:1.2.3.4'), "\n"; 1.2.3.4 So I don't see a problem here.