Re:IPv4 addresses are silly, inet_aton(3) doubly so
by midasuni on Wednesday November 03, 2021 @03:40AM
(#29092024)
To me, the hexadecimal view is horrendous and one of the reasons ipv6 is so nasty
[ Parent
| on HN ]
Re:IPv4 addresses are silly, inet_aton(3) doubly so
by jml7c5 on Wednesday November 03, 2021 @07:20AM
(#29093164)
It's the colons that do it, in my opinion. They visually fill the gaps between segments, which makes it harder to pick out what is a digit and what is "empty space". Compare:
6d08:048c:4c3b:57f0:0bca:f236:e8ab:b52e
with 6d08-048c-4c3b-57f0-0bca-f236-e8ab-b52e
Though the best solution is to fully embrace the ASCII lifestyle that modern teletypes allow, and use the record separator 0x1f: 6d08048c4c3b57f00bcaf236e8abb52e
Re:IPv4 addresses are silly, inet_aton(3) doubly so
by jml7c5 on Wednesday November 03, 2021 @11:38AM
(#29096161)
(I'll take this opportunity to repeat an earlier bikeshed of mine, which is that IPv6 address syntax should have used hyphens instead of colons, and dealt with the ensuing "is it a hostname or ip address?" problem by always requiring square brackets:
[abcd-ef01--2345]
C'est la vie.)
Re:IPv4 addresses are silly, inet_aton(3) doubly so
by RL_Quine on Wednesday November 03, 2021 @03:47AM
(#29092053)
Yeah, IPv6 being variable length hexadecimal makes it difficult for people to pattern match. I can typically expect that users know what the four groups represents, but IPv6 being represented in such varying ways means that I can't expect the same of it.
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)