News for hackers. Stuff that matters.
Re:IPv4 addresses are silly, inet_aton(3) doubly so by maxdamantus on Wednesday November 03, 2021 @07:03AM (#29093062)
Personally, I make use of this all the time. My home network uses the 10.0/8 subnet, so I'll naturally use 10.137 in commands like ping, ssh, curl, ifconfig. Other than web browsers and the `ip` command, virtually everything that I might enter an IP address in seems to support the two- and three-part addresses. I've always thought of the lack in `ip` as a bug [0]; `ip route add default via 10.138` seems to misinterpret the address as 10.138.0.0 (or as I would say, 10.138.0).

Note that this is also nice for loopback addresses. Normally the loopback interface owns all addresses in the 127.0/8 subnet, so you can listen on any address from 127.1 to 127.16777214.

[0] EDIT: looking into this, it seems that they "fixed" it at some point but then reverted the fix for legacy reasons: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=865992

Re:IPv4 addresses are silly, inet_aton(3) doubly so by notwedtm on Wednesday November 03, 2021 @10:21AM (#29094980)
I believe IP does this because it's anticipating a CIDR range of `10.138/16` here.