-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Use configured net interface even when it is missing #12487
Conversation
Just to add, qBt currently passes localhost to only the listen interfaces. Not for outgoing interface. So IP gets leaked anyway. The correct thing to do would be not force localhost on startup due to invalid interface name/IP. This way IP will not get leaked and user can continue to download as soon as VPN/Specific interface/IP is back online. |
Sorry, I don't get it, how does not forcing localhost prevent the IP from getting leaked? I'm also confused by the libtorrent docs (https://libtorrent.org/reference-Settings.html#outgoing_interfaces); they say: |
@FranciscoPombal I recently tried to clarify that: https://github.com/arvidn/libtorrent/pull/4492/files |
For reference, the new docs say:
@An0n666 as long as everything works as expected, this is fine by me (I don't have the time to test this right now, sorry). But the more I look into the libtorrent code, the more I think that the interface handling code in qBittorrent needs a severe overhaul. As an example, it is not clear whether the user is configuring the listen interfaces or the outgoing interfaces, it is not possible to configure them separately, and there is not fine-grain control of multi-homed setups. |
I think it was a bit of a mistake to separate I think it's reasonable to set I'm envisioning a future where binding outgoing TCP sockets to one of the listen interfaces is a bool settings, not allowing independent lists of interfaces. |
I could test but need a test build. Currently don't have my system where I have build tools for windows. |
Is there something about this PR that is specific to Windows that you want to test (just curious)? In either case, maybe @xavier2k6 can get you a build. |
@An0n666 let me know what exact qBittorrent & libtorrent commits you want in a test build & will try to get you one when I can. |
PR rebased based on current master. So you can use this branch. The latest commits on RC_1_2 would do. |
@An0n666 qBittorrent commit 9855558 with libtorrent RC_1_2 commit ebc2bfc |
Ok I've tested it. Now when started with invalid interface, listen sockets are not being opened.
Connection icon was turned red saying qBt failed to listen on selected port(which is expected). @arvidn |
It's the other way around. I'm sorry that this API is not very good (I'll try to improve it in future versions). Outgoing TCP peer connections are not affected by the So, As far as I can tell, the most reasonable behavior for a client is to set Doing that should make the behavior more uniform and reasonable. As far as I know, then TCP connections and uTP connections would behave the same. In fact, I'm envisioning a future where the |
This comment has been minimized.
This comment has been minimized.
Nevermind...My VPN was setup as PPTP on Windows..Changed to TAP-Windows Adaptor now and the issue with outgoing connections is gone. |
This PR will require a small change for Windows users. When the specific interface GUID can’t be fetched, force listening on localhost for both incoming and outgoing interfaces. |
does the GUID change when the VPN goes down and comes back up again? |
No it wasn't changing. My VPN was setup as PPTP device. Which apparently vanishes if disconnected. So GUID can't be fetched. Anyways that was solved by using a VPN adapter. Btw I found a bug in qBt where it was passing empty strings to |
PR updated and tested. qBt will just pass whatever invalid interface user has chosen. If interface become available later on, libtorrent will open up sockets and connection will resume. Addressed the IP leak issue. If the interface GUID can't be fetched (in Windows), we'll pass whatever interface name was set instead of the GUID. As passing empty strings to outgoing interface was causing IP leaks. |
@An0n666 since you removed the previous explanatory comment, I think you should add new ones, explaining the reasoning of why it's now done like this when using libtorrent 1.2.x |
I'm not exactly sure what happens when you pass an invalid interface in RC_1_1. The listen sockets shouldn't be opened anyway. |
I looked into RC1_1 and found that it's exactly the same. The IP leak issue was introduced by qBt actually. qBittorrent/src/base/bittorrent/session.cpp Lines 1175 to 1177 in 4d00435
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't merge until 22nd of April.
I see this PR and the previous ones and I would like to overhaul the whole thing. I am going to take a stab at it.
If you don't see any news from me until the 22nd then feel free to proceed with this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind. I read the 2 functions now, and I can't immediately see how I can better refactor them.
On another note: You should drop the if (outgoingInterfaces.isEmpty()) {
codeblock in Session::configureNetworkInterfaces()
. As far as I can tell it is totally useless now.
I am sorry for remembering this so late in the PR process, but the commit title is probably unsuitable. |
@sledgehammer999 can you please release 4.2.4 soon? The recent connectivity fixes in qBIttorrent + libtorrent side fix a lot of problems that users keep reporting because 4.2.4 is not officially released yet. Plus there are a bunch of other important fixes, such as the auto disk cache fix. Releasing 4.2.4 will enable us to close the existing proxy/udp threads (and other threads) which have a lot of information that's not relevant anymore, so we can focus on the issues that are not yet fixed. |
@FranciscoPombal I have heard you the 1st time. As you probably know this PR is important too for v4.2.4. |
Sorry for insisting, just wanted to make sure. This one is also ready and can be included in the release: #12568 |
To be fair, you could reply :P Was thinking it would be great if Github like Microsoft's Feedback Hub would find similar or related issues first before allowing the creation of a new issue. Maybe it's best just to ignore these duplicate issues and delete them after the new version has been released. Hopefully going forward 4.x can keep the issues to a minimum, this client has had it's fair share and it might've put people off. it's come a long way though, thanks to all involved. I'm starting to phase out uTorrent now :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but cannot really test it.
Seems it shouldn't affect the cases when there are no problems with configured interface.
@An0n666 thx. Merging and preparing to release v4.2.4 |
Follow up to #12253 (comment)