Re:Support for IPv6
by throw0101a on Friday September 20, 2024 @03:35PM
(#41604924)
> gethostbyname
Hmm:
> The gethostbyname*(), gethostbyaddr*(), herror(), and hstrerror() functions are obsolete. Applications should use getaddrinfo(3), getnameinfo(3), and gai_strerror(3) instead.
* https://man7.org/linux/man-pages/man3/gethostbyaddr.3.html
I know, I said I've (unintentionally) built software which only works with v4, not that the current best practice is to only work with v4.
Using gethostbyname turned out to be pretty easy by the way, I wouldn't say it was a lot more work than using getaddrinfo
Now the software itself would probably work v6 if you set up the infrastructure for it, but that's not what I'm talking about. (I don't know for sure that it works with v6 though, never tested)
I know for sure that I've written some software before which doesn't work with IPv6 because the buffer I pass to gethostbyname is 4 bytes, but to be fair I haven't written such software in 2024. I have also written software to configure a device's interfaces and routing tables which only does DHCP4 and only configures v4 addresses, but that was in 2023 not 2024, maybe dhcp4 would've magically worked with IPv6 if I had done it this year