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

TcpSocketHandler::listen() does not loop over IPv6 interfaces while connecting to an IPv4 host #669

Open
gkiessling opened this issue Oct 24, 2024 · 2 comments

Comments

@gkiessling
Copy link
Contributor

Eternal Terminal client fails for me when trying to forward a port. If I remove the port forwarding from the command below, et connects successfully:

$ et --verbose=9 -t "3389:3389"  10.1.2.3
Error binding 10/1/6: 99 Cannot assign requested address

Error establishing port forward: Error binding port 3389: 99 Cannot assign requested address

This error occurs no matter what source port I choose. It is not failing because the port is in use.

Looking at the TcpSocketHandler::listen() source for the error output, it looks like it is failing when trying to bind to an IPv6 interface, as the addrinfo.ai_family value 10 maps to AF_INET6. But given that I've specified an IPv4 host address on the command line, I believe the correct behaviour for et in this scenario should be to skip over IPv6 interfaces. To test this idea, I hard-coded a continue for the case when p->ai_family == AF_INET6 and my et connection with port forwarding subsequently worked (this was just a test, not a proposed solution for the bug).

etclientLogs.tar.gz

@gkiessling gkiessling changed the title TcpSocketHandler::listen() does not loop over IPv6 interfaces while connecting with IPv4 TcpSocketHandler::listen() does not loop over IPv6 interfaces while connecting to an IPv4 host Oct 24, 2024
@gkiessling
Copy link
Contributor Author

$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.5 LTS"
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

@gkiessling
Copy link
Contributor Author

$ sudo lshw -c cpu
  *-cpu                     
       description: CPU
       product: 13th Gen Intel(R) Core(TM) i7-13700H
       vendor: Intel Corp.
       physical id: 400
       bus info: cpu@0
       version: 6.186.2
       slot: U3E1
       size: 642MHz
       capacity: 4800MHz
       width: 64 bits
       clock: 100MHz
       ...

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

1 participant