Skip Menu |

This queue is for tickets about the Regexp-IPv6 CPAN distribution.

Report information
The Basics
Id: 62125
Status: open
Worked: 5 min
Priority: 0/
Queue: Regexp-IPv6

People
Owner: salva [...] cpan.org
Requestors: Test [...] globis.net
Cc:
AdminCc:

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



Subject: :: is not recognised as a valid IPv6 address prefix by Regexp-IPv6
Date: Thu, 14 Oct 2010 14:39:19 +0200
To: bug-Regexp-IPv6 [...] rt.cpan.org
From: Test <Test [...] globis.net>
An often used shorthand for the default route in IPv6 notation is the prefix "::/0" I was testing my own perl prefix creation libraries which tested whether the first portion of the prefix was a valid IPv6 address and it failed on the case ::/0. Regexp-IPv6 does not seem to recognise that "::" is a valid address corresponding to the all zeros IPv6 address 0000:0000:0000:0000:0000:0000:0000:0000 sample code: perl -e "use Regexp::IPv6 qw($IPv6_re); print '::0'=~$IPv6_re" 1 perl -e "use Regexp::IPv6 qw($IPv6_re); print '::'=~$IPv6_re" <undef>
'::' is rejected on purpose. It is estated on the documentation. If you want to accept it just use /^(?:$IPv6_re|::)$/
Subject: Re: [rt.cpan.org #62125] :: is not recognised as a valid IPv6 address prefix by Regexp-IPv6
Date: Thu, 14 Oct 2010 15:57:00 +0200
To: bug-Regexp-IPv6 [...] rt.cpan.org
From: Test <Test [...] globis.net>
Salvador Fandino Garcia via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=62125> > > '::' is rejected on purpose. It is estated on the documentation. > > If you want to accept it just use /^(?:$IPv6_re|::)$/ > >
Thanks for the reply. I understand your thinking, and I have of course already implemented my own workaround, but can't help but think that this is going to cause other people problems in production. There should at least be some clearer explanation of the thinking here, or perhaps two regexps to choose from, one including and one excluding "::". Not everyone is at home in regexp syntax, which is why your library will be so useful. There are already so many examples of bad regexps out there on the web. I have contacted the authors of rfc5952 about this specific case. https://tools.ietf.org/html/rfc5952#section-4.2.1 says you must always shorten an address as far as possible when applying "::". That means the all zeros address 0000:0000:0000:0000:0000:0000:0000:0000 gets shortened to "::" But if you then try to expand "::" back to 0000:0000:0000:0000:0000:0000:0000:0000 you have a problem. RFC5952 would seem to suggest that :: is valid and should map back to 0000:0000:0000:0000:0000:0000:0000:0000 RFC2373 would suggest that "::" is only partially valid and corresponds to the unspecified address XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX hence your regexp says that this is an invalid IPv6 address. This sort of ambiguity in the standards might just explain why so many people have problems adding a default route to ::/0 in their systems, and instead have to use 2001::/3, which of course is only a route for IPv6 unicast traffic. It's not as though the default route is a rare use case. Almost every end user system has one, and most routers too. I think it is important that all well-used IPv6 libraries make the same assumptions and work the same way, especially in this case. I'll let you know how/if they respond.
Subject: Re: [rt.cpan.org #62125] :: is not recognised as a valid IPv6 address prefix by Regexp-IPv6
Date: Fri, 15 Oct 2010 11:55:46 +0200
To: bug-Regexp-IPv6 [...] rt.cpan.org
From: Test <Test [...] globis.net>
Salvador Fandino Garcia via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=62125> > > '::' is rejected on purpose. It is estated on the documentation. > > If you want to accept it just use /^(?:$IPv6_re|::)$/ > >
RFC 2373 has been updated by RFC 4291 and further clarified by RFC 5952 Check out RFC 4291 http://tools.ietf.org/html/rfc4291#page-4 Section 2 says that an all zeros address is valid unless explicitly excluded elsewhere Section 2.2 says :: is valid Section 2.5. states that the unspecified address must not be used as the destination address of IPv6 packets or in IPv6 Routing headers. An IPv6 packet with a source address of unspecified must never be forwarded by an IPv6 router. So it is only excluded for use as a destination address. The unspecified address can be, and actually is used, as a source address e.g. during node start up. It is also used as part of the default route prefix ::/0 and is therefore valid. So I would humbly suggest that you modify the regexp to include "::" as a valid IPv6 address.
From: stolen-from-bitcard [...] l2g.to
I'm in agreement with Test@globis.net on this ticket.