3 ms·
Even putting aside the ambiguity of using ':' as a address:port delimiter, there are differences between platforms in parsing just IPv6 addresses e.g. on Linux
by nly 8y ago
Even putting aside the ambiguity of using ':' as a address:port delimiter, there are differences between platforms in parsing just IPv6 addresses
e.g. on Linux/glibc 2.28
[cling]$ #include <arpa/inet.h>
[cling]$ ::in6_addr dst;
[cling]$ dst
(::in6_addr &) @0x7ff318aff010
[cling]$ inet_pton (AF_INET6, "1234:1234:1234:1234:1234::1234:8.8.8.8", &dst)
(int) 0
[cling]$ inet_pton (AF_INET6, "1234:1234:1234:1234:1234:1234:8.8.8.8", &dst)
(int) 1
Here '::' in this 'full' address is (correctly) rejected.
However, although I haven't verified this on FreeBSD (perhaps someone can?), there's a comment in the libc source suggesting that this will be accepted there
https://github.com/freebsd/freebsd/blob/1d6e4247415d264485ee94b59fdbc12e0c566fd0/lib/libc/inet/inet_pton.c#L127 https://github.com/freebsd/freebsd/blob/1d6e4247415d264485ee...
Parsing sucks.