dictd and IPv6 support
dictd as it stands now (9a2f53e) works only with IPv4 (for example, it still uses gethostbyname function). There were efforts in Red Hat to make all their programs working with IPv6, including this bug for dictd. That included this patch against 1.9.15 by @dkopecek, but the patch has never been finished and applied, AFAIK. It meanwhile bitrotten, so it cannot be directly applied to the current checkout.
Attaching the patch here, so it is preserved for posterity.
Fixed in dictd-1.13.0. Thanks a lot for pointing out!
Hmm, rpmlint still complains:
dictd.x86_64: I: binary-or-shlib-calls-gethostbyname /usr/sbin/dictd
The binary calls gethostbyname(). Please port the code to use getaddrinfo().
Oops. You are right. There are still some gethostbyname :-/
Is it possible, to listen on all addresses, both IPv4 and IPv6? If yes, how? If not, this would be a good enhancement.
Is it possible, to listen on all addresses, both IPv4 and IPv6? If yes, how? If not, this would be a good enhancement.
I have patches against dictd-1.13.1 that do just that, if anyone is interested...
dictd supports IPv6 in 1.13.1. If you want it to be listening in both, IPv4 and IPv6, you can start it listening to IPv6 --address-family 6 and it will do both.
Not necessarily. Depends on the OS, and system settings.
You need to set the IPV6_V6ONLY flag to "off" on the socket, hence why I needed the patch.
Also, some systems don't support IPv4 on Ipv6 sockets at all (OpenBSD)
Incidentally, when IPV6_V6ONLY is set, you (obviously) can't bind the socket to listen to a specific address.
These are my current patches against 1.31.1: dictd.patch
@Jamie-Landeg-Jones ,
You are right, ... after I mentioned that I thought of other Unix systems where dictd runs, plus the ipv6 only.
I had started a solution too but using the posix select(..) to try to listen on both sockets by default thinking of Unix. It sort of works but needs some cleanup. I'll see if I can prepare a PR that incorporates also the IPV6_V6ONLY flag.
It would be nice to have the ability to have listeners on independent sockets (that way you can specify which address to listen on, instead of INADDR_ANY), but I took the lazy way out.
Prior to that, I was running 2 separate dictd instances, but that got a bit heavy when running 252 databases :-) (https://dictionary.catflap.org/?Form=/4)