Fun with domain names - The WWW

Users browsing this thread: 2 Guest(s)
venam
Administrators
(26-08-2020, 10:55 AM)vain Wrote: Why? What is/was a legitimate use case for this form?

While the previous IDN is valid as host writing, using the concept of domain to ascii or IDNA, the ipv4 representation isn't actually valid as far as the URL standard goes but it seems to still be interpreted by the browser, cURL, and others.

You can even represent it as hex: http://0xb23eec50 or octal: http://026217566120

So I have found at which level it is done, it's also from something getaddrinfo calls.
I've found the culprilt, it is inet_aton(3).

Relevant from the manpage, but not compatible with URL specs:

Code:
inet_aton() converts the Internet host address cp from the IPv4 numbers-and-dots
       notation into binary form (in network byte order) and stores it in the structure
       that inp points to.  inet_aton() returns nonzero if the address is  valid,  zero
       if not.  The address supplied in cp can have one of the following forms:

       a.b.c.d   Each  of  the  four numeric parts specifies a byte of the address; the
                 bytes are assigned in left-to-right order to produce  the  binary  ad‐
                 dress.

       a.b.c     Parts a and b specify the first two bytes of the binary address.  Part
                 c is interpreted as a 16-bit value  that  defines  the  rightmost  two
                 bytes of the binary address.  This notation is suitable for specifying
                 (outmoded) Class B network addresses.

       a.b       Part a specifies the first byte of the binary address.  Part b is  in‐
                 terpreted  as a 24-bit value that defines the rightmost three bytes of
                 the binary address.  This notation is suitable  for  specifying  (out‐
                 moded) Class A network addresses.

       a         The  value  a is interpreted as a 32-bit value that is stored directly
                 into the binary address without any byte rearrangement.

       In all of the above forms, components of the dotted address can be specified  in
       decimal,  octal  (with  a  leading  0), or hexadecimal, with a leading 0X).  Ad‐
       dresses in any of these forms are collectively termed IPV4 numbers-and-dots  no‐
       tation.   The form that uses exactly four decimal numbers is referred to as IPv4
       dotted-decimal notation (or sometimes: IPv4 dotted-quad notation).

One thing is sure in computing, it's that standards are only ideals.


Messages In This Thread
Fun with domain names - by venam - 24-08-2020, 08:25 AM
RE: Fun with domain names - by z3bra - 24-08-2020, 09:23 AM
RE: Fun with domain names - by venam - 24-08-2020, 09:26 AM
RE: Fun with domain names - by s0kx - 24-08-2020, 12:33 PM
RE: Fun with domain names - by venam - 24-08-2020, 12:45 PM
RE: Fun with domain names - by jkl - 24-08-2020, 03:15 PM
RE: Fun with domain names - by z3bra - 25-08-2020, 10:24 AM
RE: Fun with domain names - by venam - 25-08-2020, 11:12 AM
RE: Fun with domain names - by z3bra - 25-08-2020, 11:36 AM
RE: Fun with domain names - by movq - 26-08-2020, 10:55 AM
RE: Fun with domain names - by venam - 26-08-2020, 11:16 AM
RE: Fun with domain names - by z3bra - 27-08-2020, 05:24 AM
RE: Fun with domain names - by venam - 27-08-2020, 05:41 AM
RE: Fun with domain names - by venam - 27-08-2020, 07:00 AM