This archive is retained to ensure existing URLs remain functional. It will not contain any emails sent to this mailing list after July 1, 2024. For all messages, including those sent before and after this date, please visit the new location of the archive at https://mailman.ripe.net/archives/list/ripe-atlas@ripe.net/
[atlas] IPv4 leading zeroes and weird interface behaviour
- Previous message (by thread): [atlas] IPv4 leading zeroes and weird interface behaviour
- Next message (by thread): [atlas] IPv4 leading zeroes and weird interface behaviour
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Nick Hilliard
nick at inex.ie
Wed Oct 25 23:05:27 CEST 2017
Max Grobecker wrote: > Now I'm puzzled: Of course, writing IPv4 octets with leading zeroes is not very common. > But: Is it officially prohibited or discouraged? It was never defined in the rfcs, but by rfc convention, leading zeros should probably be interpreted as decimal (e.g. rfc790). The problem is, inet_aton() interprets leading zeros as octal, and on any operating system which uses the bsd socket library, the address may get converted into octal, or may not, depending on whether the program is using inet_aton(), which assumes octal if there are leading zeros, or getaddrinfo(), which will interpret as decimal in all cases, because POSIX was a bit more careful about the definition. In other words, you have no idea a priori what someone else's code will do, so unless you're ok about your output being interpreted as random garbage, you should avoid zero-padding at all costs. Nick
- Previous message (by thread): [atlas] IPv4 leading zeroes and weird interface behaviour
- Next message (by thread): [atlas] IPv4 leading zeroes and weird interface behaviour
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]