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

Connection filter code attempts to resolve remote address for listen connection #10622

Closed
piru opened this issue Feb 27, 2023 · 2 comments
Closed
Assignees
Labels

Comments

@piru
Copy link

piru commented Feb 27, 2023

I did this

curl -v --ftp-port "-" ftp://ftp.funet.fi

In output I see a bogus error:

...
* sa_addr inet_ntop() failed with errno 47: Address family not supported by protocol family
...

The error is due to set_remote_ip() call in Curl_conn_tcp_listen_set() with unset ctx->addr.sa_addr. See

set_remote_ip(cf, data);

I expected the following

No superfluous errors being reported.

curl/libcurl version

curl 7.88.1 (aarch64-apple-darwin22.3.0) libcurl/7.88.1 OpenSSL/3.0.8 zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) nghttp2/1.52.0
Release-Date: 2023-02-20
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTPS-proxy IDN IPv6 Largefile libz NTLM NTLM_WB PSL SSL threadsafe TLS-SRP UnixSockets zstd

operating system

Darwin computername.local 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 arm64

@bagder bagder added the FTP label Feb 27, 2023
icing added a commit to icing/curl that referenced this issue Feb 28, 2023
- refs curl#10622, do not try to determine the remote address of
  a listen socket. There is none.
- Update remote address of an accepted socket by getpeername()
  if available.
@icing
Copy link
Contributor

icing commented Feb 28, 2023

Thanks for the report. Please see #10642 for the fix.

@piru
Copy link
Author

piru commented Feb 28, 2023

This fixes the issue for me, thanks!

@piru piru closed this as completed Feb 28, 2023
bagder pushed a commit that referenced this issue Feb 28, 2023
- do not try to determine the remote address of a listen socket. There
  is none.
- Update remote address of an accepted socket by getpeername() if
  available.

Reported-by: Harry Sintonen
Fixes #10622
Closes #10642
bch pushed a commit to bch/curl that referenced this issue Jul 19, 2023
- do not try to determine the remote address of a listen socket. There
  is none.
- Update remote address of an accepted socket by getpeername() if
  available.

Reported-by: Harry Sintonen
Fixes curl#10622
Closes curl#10642
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants