News for hackers. Stuff that matters.
Re:IPv4 addresses are silly, inet_aton(3) doubly so by georgyo on Wednesday November 03, 2021 @05:21AM (#29092499)
It's only "nasty" because you are not used to it.

Decimal representation didn't make much sense either but we have decades of normalizing it.

Why is 255 the max in an octet?

Why do we call them octets?

I have a /23 and I want to add 10 to 192.168.0.253, how can I do this?

0.253 + 10 = 1.7

0xfd + 0xa = 0x107

Which one makes more sense?

We like the decimal representation because that's how we grew up. It doesn't actually make much sense.

Re:IPv4 addresses are silly, inet_aton(3) doubly so by mysterydip on Wednesday November 03, 2021 @07:39AM (#29093322)
> Why do we call them octets?

It's an 8 bit value

> Why is 255 the max in an octet?

255 is the largest 8 bit value

Re:IPv4 addresses are silly, inet_aton(3) doubly so by Ekaros on Wednesday November 03, 2021 @07:10AM (#29093093)
Also hexadecimal would sort much nicer. Compared to dot notation. As really logically you want to sort them by groups, not as strings.
Re:IPv4 addresses are silly, inet_aton(3) doubly so by iso1631 on Wednesday November 03, 2021 @08:04AM (#29093493)
My non-base-ten mental arithmatic isn't great, it's rare I need to do it (my typical subnets are /27 or /28, very rare I'll have a /23 or larger) so I hit alt-enter to open up a new terminal, type "bc", and job done

~$ bc obase=256 253+10 001 007

But adding 10 to 0xfd? That involves converting 10 to 0xa, then adding to FD

~$ bc obase=16 10 A ibase=16 FD+A 107

Far more involved.

Re:IPv4 addresses are silly, inet_aton(3) doubly so by megous on Wednesday November 03, 2021 @07:15AM (#29093126)
Imagine setting filesystem permissions in decimal and not in octal. :)
Re:IPv4 addresses are silly, inet_aton(3) doubly so by post-it on Wednesday November 03, 2021 @07:32AM (#29093262)
Filesystem permissions are fundamentally arranged in groups of three bits. Octal is a natural representation for them.
Re:IPv4 addresses are silly, inet_aton(3) doubly so by tfigment on Wednesday November 03, 2021 @08:00AM (#29093456)
Imagine a file system where 2 or more users could have independent permissions to a file without being members of a single shared group or sharing with the world or using bolt-on software to enforce.
Re:IPv4 addresses are silly, inet_aton(3) doubly so by uuidgen on Wednesday November 03, 2021 @09:52AM (#29094539)
Current permission is really old, backward-compatible and simple system that works well in most situations.

setfacl exists is supported for years (although I prefer windows file permission logic to be honest)