Mac@programming.dev to Programmer Humor@programming.dev · 9 months agoGoOnprogramming.devimagemessage-square108fedilinkarrow-up11.05Karrow-down148
arrow-up11.01Karrow-down1imageGoOnprogramming.devMac@programming.dev to Programmer Humor@programming.dev · 9 months agomessage-square108fedilink
minus-squarep1mrx@sh.itjust.workslinkfedilinkarrow-up2·9 months ago Because 1.2.3.4 and 1.02.003.04 both map to the same number. But 10.20.30.40 and 010.020.030.040 map to different numbers. It’s often best to reject IPv4 addresses with leading zeroes to avoid the decimal vs. octal ambiguity.
minus-squareDanny M@lemmy.escapebigtech.infolinkfedilinkarrow-up2·9 months agoI don’t know why anyone would write their IPs in octal, but fair point
minus-squarep1mrx@sh.itjust.workslinkfedilinkarrow-up2·9 months agoIt’s not about how people write them, it’s how parsers parse them. IPv4 has been around since 1982, and most parsers interpret leading zeros as octal.
But 10.20.30.40 and 010.020.030.040 map to different numbers. It’s often best to reject IPv4 addresses with leading zeroes to avoid the decimal vs. octal ambiguity.
I don’t know why anyone would write their IPs in octal, but fair point
It’s not about how people write them, it’s how parsers parse them. IPv4 has been around since 1982, and most parsers interpret leading zeros as octal.