• partial_accumen@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    ·
    16 days ago

    Just to be pedantic, but was this a valid IPv4 address before IPv6 came out? That mechanism of collapsing a single set of repeating octets of “0” is a feature of IPv6.

    So the behavior we’re seeing here, does this only result because that machine also supports IPv6?

    • Taldan@lemmy.world
      link
      fedilink
      English
      arrow-up
      8
      ·
      16 days ago

      No, this has been a part of IPv4 for a very long time. The behavior is defined here. There are also differences in how the collapse white space, primarily in that IPv6 can collapse multiple zero sections

      While many systems support these funky IPv4 address formats, not all do. It’s a bit of a quirk in that intimate knowledge of IPv4 addressing has largely been lost. If you search for validating IPv4 addresses on StackOverflow, most answers will simplistically check for 4 octets between 0 and 255

      The only place I’ve seen these IPv4 address formats be relevant in the last 10 years is in security. If you’re using a block list to block specific IP addresses (which is pretty dumb to do these days), you have to account for someone sending a request with their IP address in hex, octal, or shortened formats. If you block 127.69.69.69 (yes, I know that’s a loopback), and are getting a request from 2135246149, will your block list recognize it as a blocked address? Many won’t, but that’s something you have to engineer for from a security perspective

      • partial_accumen@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        16 days ago

        No, this has been a part of IPv4 for a very long time. The behavior is defined here. There are also differences in how the collapse white space, primarily in that IPv6 can collapse multiple zero sections

        " a.b When a two-part address is supplied, the last part shall be interpreted as a 24-bit quantity and placed in the rightmost three bytes of the network address. This makes the two-part address format convenient for specifying Class A network addresses as “net.host”."

        You’re right. I’d never seen that usage before, but its in the man page.

  • grillgamesh@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    13
    arrow-down
    5
    ·
    16 days ago

    yeah yeah its just localhost… come back when you have an actually interesting publicly pingable IP.

    hex, binary, and base 10 have always been valid ping inputs, from way back when, during the before times, when RFCs were still in the hundreds, and the TCP/IP stack was still young.