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

bind to ipv6 address #278

Closed
BChabanne opened this issue Sep 28, 2024 · 1 comment
Closed

bind to ipv6 address #278

BChabanne opened this issue Sep 28, 2024 · 1 comment

Comments

@BChabanne
Copy link

BChabanne commented Sep 28, 2024

It seems that it is not possible for capnp-rpc server to bind to ipv6 addresses.

The error I get when serving such vat config

  let vat_config =Capnp_rpc_unix.Vat_config.create ~secret_key:(`File "/tmp/key") (`TCP ("::1", 7000))

is Failure("Unknown host \"::1\"")

After searching a little bit, I found this related issue ocaml/ocaml#13114
It seems that the function gethostbyname is not supporting ipv6 but getaddrinfo does.

Would it make sense to use getaddrinfo in files unix/network.ml and unix/capnp_rpc_unix.ml ? instead of gethostbyname to support ipv6 ?

If ipv6 is to be supported, Network.Location.of_string would also need to be reworked a bit, because command line parsing would fail with

'--capnp-listen-address': PORT must be an integer

If there are no other big blockers you can think of, I can start to work on a PR to support ipv6

talex5 added a commit to talex5/capnp-rpc that referenced this issue Nov 26, 2024
Now accepts e.g. "tcp:[::1]:7000".

Reported by Benjamin Chabanne in mirage#278.
@talex5
Copy link
Contributor

talex5 commented Nov 26, 2024

Fixed by #284 and #296.

@talex5 talex5 closed this as completed Nov 26, 2024
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

2 participants