←back to thread

1895 points _l4jh | 1 comments | | HN request time: 0s | source
Show context
DyslexicAtheist ◴[] No.16728255[source]
TIL you can also use 1.1 and it will expand to 1.0.0.1

  $> ping 1.1

  PING 1.1 (1.0.0.1) 56(84) bytes of data.
  64 bytes from 1.0.0.1: icmp_seq=1 ttl=55 time=28.3 ms
  64 bytes from 1.0.0.1: icmp_seq=2 ttl=55 time=33.0 ms
  64 bytes from 1.0.0.1: icmp_seq=3 ttl=55 time=43.6 ms
  64 bytes from 1.0.0.1: icmp_seq=4 ttl=55 time=41.7 ms
  64 bytes from 1.0.0.1: icmp_seq=5 ttl=55 time=56.5 ms
  64 bytes from 1.0.0.1: icmp_seq=6 ttl=55 time=38.4 ms
  64 bytes from 1.0.0.1: icmp_seq=7 ttl=55 time=34.8 ms
  64 bytes from 1.0.0.1: icmp_seq=8 ttl=55 time=45.7 ms
  64 bytes from 1.0.0.1: icmp_seq=9 ttl=55 time=45.2 ms
  64 bytes from 1.0.0.1: icmp_seq=10 ttl=55 time=43.1 ms
replies(5): >>16728294 #>>16728342 #>>16728382 #>>16728420 #>>16729271 #
dieulot ◴[] No.16728382[source]
The most useful case for this shortcut is 127.1 -> 127.0.0.1
replies(3): >>16728626 #>>16728629 #>>16729229 #
avip ◴[] No.16728626[source]
Don't try that in the wild, most sw out there would ignore spec and use some arbitrary regex to validate IP format.

i.e python:

    octets = ip_str.split('.')
    if len(octets) != 4:
        raise AddressValueError("Expected 4 octets in %r" % ip_str)
replies(1): >>16729004 #
sigjuice ◴[] No.16729004[source]
What spec says that 127.1 and 127.0.0.1 are equivalent?
replies(2): >>16729069 #>>16729584 #
1. avip ◴[] No.16729584{4}[source]
You are right, I faithfully assumed it's a spec without checking. Thanks.