Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dictd and IPv6 support #5

Open
mcepl opened this issue Jan 26, 2019 · 10 comments
Open

dictd and IPv6 support #5

mcepl opened this issue Jan 26, 2019 · 10 comments

Comments

@mcepl
Copy link

mcepl commented Jan 26, 2019

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.

@cheusov
Copy link
Owner

cheusov commented Mar 29, 2020

Fixed in dictd-1.13.0. Thanks a lot for pointing out!

@cheusov cheusov closed this as completed Mar 29, 2020
@mcepl
Copy link
Author

mcepl commented Mar 30, 2020

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().

@cheusov
Copy link
Owner

cheusov commented Mar 30, 2020

Oops. You are right. There are still some gethostbyname :-/

@cheusov cheusov reopened this Mar 30, 2020
@frituc
Copy link

frituc commented Aug 17, 2020

Is it possible, to listen on all addresses, both IPv4 and IPv6? If yes, how? If not, this would be a good enhancement.

@Jamie-Landeg-Jones
Copy link

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...

@carlosrodfern
Copy link
Contributor

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.

@Jamie-Landeg-Jones
Copy link

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.

@Jamie-Landeg-Jones
Copy link

These are my current patches against 1.31.1:
dictd.patch

@carlosrodfern
Copy link
Contributor

@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.

@Jamie-Landeg-Jones
Copy link

Jamie-Landeg-Jones commented Oct 11, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants