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

Terminating connection with server without terminating connection with client #145

Open
awrenn opened this issue Sep 13, 2019 · 1 comment

Comments

@awrenn
Copy link

awrenn commented Sep 13, 2019

Hello,

I have been having issues with redsocks as a socks5 transparent proxy with the iptables redirector, only when using Rust's Cargo.

As soon as cargo reaches out to crates.io, redsocks sends the following log messages:
redsocks.c:439 redsocks_event_error(...) [...] client error, code EVBUFFER_READ|0|0|EVBUFFER_ERROR|0|0x0: No error information
[warn] Epoll MOD(4) on fd 22 failed. Old events were 6; read change was 2 (del); write change was 0 (none): Bad file descriptor [warn] Epoll MOD(1) on fd 22 failed. Old events were 6; read change was 0 (none); write change was 2 (del): Bad file descriptor

This causes the server connection to terminate, but it does not terminate the connection to cargo, which then blocks forever. Any ideas on what might be causing this/how I can fix it? Hopefully it is just a configuration issue.

@awrenn
Copy link
Author

awrenn commented Sep 18, 2019

Adding the following strace from redsocks:
close(42) = 0
epoll_ctl(3, EPOLL_CTL_MOD, 42, {EPOLLOUT, {u32=42, u64=42}}) = -1 EBADF (Bad file descriptor)
Proof that redsocks is closing the fd prematurely. I'll dig into source soon and see if I can find culprit.

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