4 comments

[ 2.7 ms ] story [ 19.9 ms ] thread
Integers are valid representations of the IP address. Why is this a shock to anyone? Most IPv4 software also still accepts dotted quads in a string...
It's not that it shocked me, but I've been in IT for very long time and never ever seen it mentioned or used even for fun.

Yeah it's not really practical, but still fun that you can enter some integer into browser address bar and get redirected to some IP address.

So you can interact with IPv4 adresses using their integer representation. And seems like HN actually accept it as valid address.
The point of semantic confusion for some, is this is a string of integers, not the actual 32 bit unsigned numeric value. So to get into the sockaddr structure it has still got to be sscanf() parsed.