-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
libtorrent https://github.com/arvidn/libtorrent/commit/9ac4e6eed88c1ea1e6cdb6865889320164ad0b85 listening on bound interface but not making outgoing connections through it #4482
Comments
thanks for testing! Is this a regression with that patch specifically? I should review it to make sure there aren't any success paths where |
OK, there's 2 strange behaviors that are affected by the patch. But overall the patch makes it more broken.
I think there is a missing or broken code path for outgoing connections. If only bind address is specified, outgoing connections should use it. If more than 1 interface has the same bind address, then outgoing connections should be distributed over all interfaces having it. In both cases, the patch breaks outgoing connections. I'm not actually sure why there is a separate bind interface and bind address setting... It makes things very confusing. |
if |
I don't quite follow... Without that commit, outgoing connections have the correct source IP only if both the interface and address to bind are selected in qBittorrent. If only the address to bind is selected in qBittorrent, outgoing connections still have the wrong source IP with or without that commit. Note: I am testing on a seedbox, where I have a single outgoing physical interface that has multiple IP addresses assigned to it. |
On Mon, Mar 30, 2020 at 2:43 PM Raif Atef ***@***.***> wrote:
I don't quite follow...
What I can say is 9ac4e6e
<9ac4e6e>
causes outgoing connections to not honor any bind settings at all.
Are you sure that's the commit that broke it?
and by "bind settings", you mean outgoing_interfaces, right?
what seems strange about this is that the call to bind() removed in that
patch, is made immediately before it as well; right where
bind_socket_to_device() returns.
Without that commit, outgoing connections have the correct source IP only
if *both* the interface and address to bind are selected in qBittorrent.
I'm not entirely familiar with how qbittorrent maps its "bind" and
"interface" settings to the libtorrent settings. In libtorrent there are
two settings listen_interfaces and outgoing_interfaces (and the latter is a
bit redundant these days, one day maybe I'll turn that to a boolean, and
use the interfaces specified as the listen interfaces).
If only the IP is selected in qBittorrent, outgoing connections still have
the wrong source IP.
is this listen_interfaces or outgoing_interfaces, do you know?
…--
Arvid Norberg
|
On Mon, Mar 30, 2020 at 3:07 PM Arvid Norberg <arvid.norberg@gmail.com>
wrote:
On Mon, Mar 30, 2020 at 2:43 PM Raif Atef ***@***.***>
wrote:
> I don't quite follow...
> What I can say is 9ac4e6e
> <9ac4e6e>
> causes outgoing connections to not honor any bind settings at all.
>
Btw, are you talking about uTP sockets?
I was just focused on TCP connections, because that's what the github
ticket is talking about. But it's possible that patch would have broken uTP.
…--
Arvid Norberg
|
I cannot reproduce this issue. Can you help me? your I'm testing with this command line:
and the peer list shows the local endpoint (correctly) as The lsof command:
Shows the outgoing connections to be bound to the VPN IP as well:
|
With this command:
I get correct listen IP but wrong outgoing connection IP. With this command
I get correct listen IP and correct outgoing connection IP. My server has a single interface eth4 but with many IPs assigned, one of which is 5.79.67.9 -- Ok so I guess the problem is actually in qBittorrent not setting libtorrent outgoing_interfaces properly. I will check there. |
thanks for testing! It's still possible there's an issue in libtorrent, but it's hard to say before we know more about what settings qbt set |
Hey @arvidn
I just compiled qBittorrent https://github.com/qbittorrent/qBittorrent/tree/v4_2_x with libtorrent 9ac4e6e and even though I selected an interface and one of its addresses to bind, libtorrent does not use it when making outgoing connections.
It is listening on the correct interface and address but making actual outgoing connections to peers over the primary interface IP (not the explicitly selected one) (seen using
lsof -i tcp -i udp -n -L | grep qbitt
) in the shell.The text was updated successfully, but these errors were encountered: