Live data from Hacker News

This is a valid ipv4 address

184.172.10.74

31–40 of 101 posts

Re: This is a valid ipv4 address

#31
This is why it's a good idea to use getaddrinfo and getnameinfo for IP address validation and normalization. While we're at it, use sockaddr's to represent addresses. in6_addr doesn't hold the IPv6 address scope/zone ID.

Re: This is a valid ipv4 address

#36

The last time this came up on HN, I decided to dig into ping and glibc's resolver stuff to find out exactly why this worked. http://rachelbythebay.com/w/2012/10/13/ping/

That article is focused on ping and glibc but the reason why this works is fundamental to IPv4 itself.

All IPv4 address are 32 bit addresses. That's why each number of an IPv4 address that people are familiar with are called octets. They represent 8 bits of the 32 bit address. So if you have 127.0.0.1, then the first octet is 127, the second is 0 and so on.

Any representation of this 32 bit number (including the most familiar A.B.C.D format) is a kind of short-hand for representing that 32 bit number.

I tried finding a link to a particular site that was phenomenal for learning the entire TCP/IP stack but I haven't seen that site since at least 1998.

But basically, if you want to spend time learning about IPv4 right before IPv6 becomes the dominant standard, then look into how hosts use the combination of IP address and subnet mask to determine if something is on the local network, how hosts use ARP to translate a 32 bit IP address into a MAC address and all the other low level protocols.

Re: This is a valid ipv4 address

#39
post #5

The decoded URL for this submission is http://184.172.10.74/ — the server for Hacker News. Here's some other encodings you can use for the same address, they're all valid and recognised by most browsers and other software: http://3098282570/ http://7393249866/ http://0xb8.0xac.0x0a.0x4a/ http://0270.0254.0012.0112/ The source for this comment is an XSS filtering bypass tool by RSnake — http://ha.ckers.org/xsscalc.htm…

More weird formats (which at least work in chrome/mac, and the mac implementation of getaddrinfo()): http://184.11274826/ http://184.172.2634/ The rule here is that the last (but apparently only the last) numeric component may encode multiple bytes.

I use this one all the time:

127.0.0.1 == 127.1

10.0.0.1 == 10.1

192.168.0.1 == 192.168.1

Re: This is a valid ipv4 address

#40
post #39

Earlier quoted context omitted.

More weird formats (which at least work in chrome/mac, and the mac implementation of getaddrinfo()): http://184.11274826/ http://184.172.2634/ The rule here is that the last (but apparently only the last) numeric component may encode multiple bytes.

I use this one all the time: 127.0.0.1 == 127.1 10.0.0.1 == 10.1 192.168.0.1 == 192.168.1

I wasn't aware of that shortcut, that's very useful.
Post reply on HN