Bug#1067760: libc6: Curious behavior of inet_pton() on IPv4 mapped numbers

2024-03-27 Thread Alessandro Vesely

On Tue 26/Mar/2024 20:14:27 +0100 Aurelien Jarno wrote:

On 2024-03-26 12:53, Alessandro Vesely wrote:

Package: libc6
Version: 2.36-9+deb12u4
Severity: normal
Tags: ipv6

Dear Maintainer,

I compiled the example program given in the  inet_pton(3) man page, and obtain
the following:

$ ./a.out i6 0:0:0::5:6:7:8
:::5:6:7:8
$ ./a.out i6 0:0:0::5.6.7.8
Not in presentation format
$ ./a.out i6 0:0:0:0:0::5.6.7.8
:::5.6.7.8


Could you please tell me what do you find curious and what do you expect
instead? Thanks.



Yeah, sorry about that.  I counted one word per tag, irrespective of it being 
hex or decimal.  So, for the last case I though heck, 10 tag is 160-bit.  I was 
so persuaded that, when Bastian told me the 8-word "0:0:0::5.6.7.8" is not 
valid I went to RFC 4291 and when I read there that the 10-tag IP 
0:0:0:0:0:0:13.1.68.3 is valid, I started filling an errata against it.  I 
copied the following passage with the idea of correcting it by removing a 
couple of "x"s.


   3. An alternative form that is sometimes more convenient when dealing
  with a mixed environment of IPv4 and IPv6 nodes is
  x:x:x:x:x:x:d.d.d.d, where the 'x's are the hexadecimal values of
  the six high-order 16-bit pieces of the address, and the 'd's are
  the decimal values of the four low-order 8-bit pieces of the
  address (standard IPv4 representation).

Only at that point I read the text carefully and realized how mistaken I was. 
I aborted the errata submission, of course.  But for the bug report, which I 
had already sent, I can only apologize.



Best
Ale



Bug#1067760: libc6: Curious behavior of inet_pton() on IPv4 mapped numbers

2024-03-26 Thread Aurelien Jarno
Hi,

Thanks for your bug report.

On 2024-03-26 12:53, Alessandro Vesely wrote:
> Package: libc6
> Version: 2.36-9+deb12u4
> Severity: normal
> Tags: ipv6
> 
> Dear Maintainer,
> 
> I compiled the example program given in the  inet_pton(3) man page, and obtain
> the following:
> 
> $ ./a.out i6 0:0:0::5:6:7:8
> :::5:6:7:8
> $ ./a.out i6 0:0:0::5.6.7.8
> Not in presentation format
> $ ./a.out i6 0:0:0:0:0::5.6.7.8
> :::5.6.7.8

Could you please tell me what do you find curious and what do you expect
instead? Thanks.

Regards
Aurelien

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://aurel32.net



Bug#1067760: libc6: Curious behavior of inet_pton() on IPv4 mapped numbers

2024-03-26 Thread Alessandro Vesely

On Tue 26/Mar/2024 17:34:20 +0100 Bastian Blank wrote:

On Tue, Mar 26, 2024 at 12:53:42PM +0100, Alessandro Vesely wrote:

I compiled the example program given in the  inet_pton(3) man page, and obtain
the following:
$ ./a.out i6 0:0:0::5.6.7.8
Not in presentation format


This is no valid IPv6 address.



Oops, you're right.  Sorry for the confusion.



 Where did you find that?



We were discussing a regex to catch all (valid) IP addresses when someone noted 
that leading zeroes are valid, albeit not the RFC 5952 recommended format. 
It's overly tricky for me.



Best
Ale



Bug#1067760: libc6: Curious behavior of inet_pton() on IPv4 mapped numbers

2024-03-26 Thread Bastian Blank
On Tue, Mar 26, 2024 at 12:53:42PM +0100, Alessandro Vesely wrote:
> I compiled the example program given in the  inet_pton(3) man page, and obtain
> the following:
> $ ./a.out i6 0:0:0::5.6.7.8
> Not in presentation format

This is no valid IPv6 address.  Where did you find that?

Bastian

-- 
"Get back to your stations!"
"We're beaming down to the planet, sir."
-- Kirk and Mr. Leslie, "This Side of Paradise",
   stardate 3417.3



Bug#1067760: libc6: Curious behavior of inet_pton() on IPv4 mapped numbers

2024-03-26 Thread Alessandro Vesely
Package: libc6
Version: 2.36-9+deb12u4
Severity: normal
Tags: ipv6

Dear Maintainer,

I compiled the example program given in the  inet_pton(3) man page, and obtain
the following:

$ ./a.out i6 0:0:0::5:6:7:8
:::5:6:7:8
$ ./a.out i6 0:0:0::5.6.7.8
Not in presentation format
$ ./a.out i6 0:0:0:0:0::5.6.7.8
:::5.6.7.8

Best
Ale



-- System Information:
Debian Release: 12.0
merged-usr: no
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-18-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/bash
Init: sysvinit (via /sbin/init)

Versions of packages libc6 depends on:
ii  libgcc-s1  12.2.0-14

Versions of packages libc6 recommends:
ii  libidn2-0  2.3.3-1+b1

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.82
ii  glibc-doc  2.36-9+deb12u4
ii  libc-l10n  2.36-9+deb12u4
ii  libnss-nis 3.1-4
ii  libnss-nisplus 1.3-4
ii  locales2.36-9+deb12u4

-- debconf information excluded