Follow

TIL
From twitter /0xInfection/status/1148267196306427904

IPv4 is usually denoted as <octet>.<octet>.<octet>.<octet> (ff.0.1.2).

Can also be denoted as hex 0xff000102 or a number as in decimal notation. However, 4.2BSD's inet_aton() allowed IPs as decimal <octet>.<24bit-decimal> or <octet>.<octet>.<16bits-decimal>.

So the last "1" gets dereferenced as a decimal notation and is hence actually the two octets 0.1

For the same reason 1.1.257 gets resolved to 1.1.1.1 as 257 is actually 0x0101

Sign in to participate in the conversation
La Quadrature du Net - Mastodon - Media Fédéré

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!