mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
4.2.0 not sending IPv6 parameter to announce #9380
Labels
No labels
Accessibility
AppImage
Bounty
Build system
CI
Can't reproduce
Code cleanup
Confirmed bug
Confirmed bug
Core
Crash
Data loss
Discussion
Docker
Documentation
Duplicate
Feature
Feature request
Feature request
Feature request
Filters
Flatpak
GUI
Has workaround
I2P
Invalid
Libtorrent
Look and feel
Meta
NSIS
Network
Not an issue
OS: *BSD
OS: Linux
OS: Windows
OS: macOS
PPA
Performance
Project management
Proxy/VPN
Qt bugs
Qt6 compat
RSS
Search engine
Security
Temp folder
Themes
Translations
Triggers
Waiting diagnosis
Waiting info
Waiting upstream
Waiting web implementation
Watched folders
WebAPI
WebUI
autoCloseOldIssue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/qBittorrent#9380
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jjbot-0 on GitHub (Dec 3, 2019).
Please provide the following information
qBittorrent version and Operating System
4.2.0 final (MacOS Catalina, Mojave)
4.2.0 final (Windows 10 build1909 64-bit)
linux not tested
What is the problem
qBit client v4.2.0 is not sending IPv6 address to the announce during initial handshake. So announce is not able to tell other clients in swarm that you are accessible via IPv6.
Affected versions NOT sending IPv6 address:
Versions correctly sending IPv6 address:
What is the expected behavior
It should send IPv6 parameter to announce.
Steps to reproduce
Install v4.2.0, v4.2.0alpha2, v4.1.9 and start torrent on a computer with an IPv6 address available. During the initial handshake client has to send some parameters to the tracker's announce including pid, info_hash, peer_id, port, event, numwant etc. The last parameter should be ipv6= followed by IPv6 address.
To reproduce easily, announce should be contacted via plain HTTP without any encryption. Use TCPDUMP
tcpdump -A host IPaddrOfAnnounceor Wireshark to see outgoing traffic to the announce.Correctly the message should seems as follow (and it does w/ v4.1.9 or v4.2.0aplha2):
...
&supportcrypto=1&redundant=0&ipv6=2a01%3ab380%... HTTP/1.1...But last part with IPv6 parameter is missing with v4.2.0:
...
&supportcrypto=1&redundant=0 HTTP/1.1...Extra info(if any)
TCPDUMP capture of v4.2.0:
TCPDUMP capture of v4.2.0RC:
TCPDUMP capture of v4.2.0beta1:
TCPDUMP capture of v4.2.0alpha2:
TCPDUMP capture of v4.1.9:
@QuintonQu commented on GitHub (Dec 3, 2019):
I got the same problem.
@jjbot-0 commented on GitHub (Dec 3, 2019):
everyone has the same. What is your OS and version, pls?
@thalieht commented on GitHub (Dec 3, 2019):
I don't think there were any changes in qBt from alpha2 to release regarding this. The only difference is that up to alpha2, libtorrent 1.1.x is used and 1.2.x since beta.
@jjbot-0 commented on GitHub (Dec 3, 2019):
looks like a huge difference to me...
@QuintonQu commented on GitHub (Dec 4, 2019):
MacOS Catalina 15.1
@Krles commented on GitHub (Dec 4, 2019):
I got the same problem.
4.2.0 final (Windows 10 version1909 64-bit)
@sledgehammer999 commented on GitHub (Dec 4, 2019):
Let's ask @arvidn (libtorrent author). @arvidn it seems that with libtorrent 1.2.2 the
ipv6=announce parameter isn't there. Did you change something in the 1.2.x series or is it a bug? (The 1.1.x series work fine).@DVD-CZ commented on GitHub (Dec 4, 2019):
I wanted to try @linux - version 4.2.0, but I can get only (the latest) :
stable = 4.1.9.99
201911190849-6738-0b055d8ubuntu18.04.1which this works as described
unstable = 4.2.0
201912040848-6798-2e8b17eubuntu18.04.1but actually it is v4.3.0alpha1 (using libtorrent 1.2), and also does not send ipv6 address.
@arvidn commented on GitHub (Dec 4, 2019):
it's a deliberate change. Since some private trackers still require it, you can enable it by setting
anonymous_modeto false. Then it will be included in announces for private torrents.@arvidn commented on GitHub (Dec 4, 2019):
however, this is not new in 1.2 though. It's been this way since 1.1.
and
anonymous_modeis false by default in libtorrent.The current logic (in 1.2.x) can be found here.
it requires the torrent to be private and anonymous_mode be false.
it then iterates over all listen sockets and adds then to the
&ipv6=and&ipv4=announce arguments, depending on which address family they're listening on.Is it possible that perhaps a change is that only
0.0.0.0is opened for listening, but not[::]?@jjbot-0 commented on GitHub (Dec 4, 2019):
@arvidn
no, both are opened IPv4&6. With exactly same configuration 1.1 (4.2.0alpha2) adds
ipv6=and 1.2 (4.2.0beta1 and newer) doesn't. Also qBit is reachable on configured port via IPv6 from outside.@sledgehammer999 commented on GitHub (Dec 4, 2019):
@jjbot-0
@arvidn commented on GitHub (Dec 4, 2019):
there's a subtle change in how the
listen_interfacessetting is interpreted in 1.2 compared to 1.1. (I consider it a cleanup and step towards a better and more regular way of expressing which IPs and interfaces to listen on).in libtorrent-1.1, if you listen to
0.0.0.0:6881(which I believe was the default), not only would an IPv4 listen socket be opened (bound toINADDR_ANY) but also an IPv6 socket would be opened.in libtorrent-1.2, if you listen to
0.0.0.0:6881only the IPv4INADDR_ANYis opened as a listen socket. If you want to listen to both IPv4 and IPv6, you need to listen to0.0.0.0:6881,[::]:6881.@jjbot-0 commented on GitHub (Dec 4, 2019):
@sledgehammer999
@sledgehammer999 commented on GitHub (Dec 4, 2019):
Interesting! Guys I have a solution in place for you to test. Unfortunately, I have to go now. I'll upload a test build in 2-3 hours.
@jjbot-0 commented on GitHub (Dec 4, 2019):
When listening is manually set to a specific interface and specific IPv6 address, the client still doesn't send the
ipv6=.Update: enjoy your time @sledgehammer999, looking forward to test your solution later. ;)
@p43b1 commented on GitHub (Dec 4, 2019):
@arvidn could be this issue related to # #3601 that, despite the status, is still unsolved?
@arvidn commented on GitHub (Dec 4, 2019):
@p43b1 it could, but I don't think so. Are you experiencing that issue with a recent qBittorrent?
@p43b1 commented on GitHub (Dec 4, 2019):
I use a VPN with both IPv4 and IPv6 addresses. With Bigly BT everything is fine on DHT side, it finds both v4 and v6 addresses, while on qBittorrent the DHT's counter marks always 0
@arvidn commented on GitHub (Dec 4, 2019):
@p43b1 please post in ticket #3601 instead of here
@sledgehammer999 commented on GitHub (Dec 4, 2019):
@jjbot-0 please try this test build: link
(run from any folder or replace original files)
This affects how the default interface is set. (
Any interface+All addressesin the qbittorrent advanced settings)The diff applied on top of v4.2.0 (
912b076707):@Gaojianli commented on GitHub (Dec 5, 2019):
Same problem on Windows with latest 4.2.0 stable, all of my private ipv6 tracker don't work at all
@jjbot-0 commented on GitHub (Dec 5, 2019):
@sledgehammer999
Excellent! It is working like a charm!
Patched v4.2.0 is correctly sending
ipv6=param to the announce, now.It suppose that qBit is in default settings, listening on Any interface/All Adresses. Choosing specific interface (ex. ethernet1)/All addresses outcomes in wrong handling of "All adresses" on that particular interface. But it is a different issue.
@arvidn commented on GitHub (Dec 5, 2019):
@sledgehammer999 Do I understand correctly that the issue was that the default
listen_interfacesin qBT is0.0.0.0:<port>, and hence it was just listening on IPv4?I'm not sure whether I should ease this transition in some way, in 1.2. On the one hand I've been trying to simplify the logic around listen sockets and reduce the amount of "magic" which I've had in previous versions. I've at least documented this change in behavior now.
@Krles commented on GitHub (Dec 5, 2019):
Thank you.
It works correctly with the fix.
@sledgehammer999 commented on GitHub (Dec 5, 2019):
@jjbot-0 (and others)
I made PR #11592 which fixes this and improves on other things.
During that refactor I discovered that Qt displays "wrongly" the link-local IPv6 addresses and libtorrent fails silently. This affects those of you who set an explicit IPv6 address in the advanced settings but still failed to see the
ipv6=parameter to the tracker announce. If you check the log you'll see that even though qbt says that it is trying to listen to the IPv6, then it has "successfully listening" messages that mention0.0.0.0only.My PR fixes the above.
Here is a build of my PR if you want to verify: http://builds.shiki.hu/temp/qbittorrent_4.2.0_x64_patched_for_issue_11561_v2.7z
@arvidn I am not sure if not doing "magic" is good or bad. On our side we just missed this behavior (and doc) change. In the transition from 1.1.x to 1.2.x we just checked for the deprecated functions and replaced them.
@jjbot-0 commented on GitHub (Dec 5, 2019):
thank you! @sledgehammer999
Patch for Mac will be released in next regular version, right?
@sledgehammer999 commented on GitHub (Dec 5, 2019):
@jjbot-0 I do my daily development on Windows, so it is hard for me to produce test builds for macOS on a regular basis. So did the 2nd test build work for you when you set an explicit IPv6 address in the advanced settings?
@jjbot-0 commented on GitHub (Dec 5, 2019):
@sledgehammer999 tried any combination:
Every combination work as expected. Port is opened (only) for appropriate combination of options.
Remark 1 - IPv4 only announce which is accepting IPv6 parameter:
There does exist announce servers working listening only on IPv4 stack, but accepting
ipv6=parameter as an info from the client. Then such announce is sending list of combined IPv4 and IPv6 addresess to the peers.But in particular case when I select option for listen on specific (or All) IPv6 addresses, then client is trying to contact announce via IPv6 only. And it fails, indeed, as announce server has no IPv6 stack available.
Adding just for completeness, this is curious setting which will not be commonly used in real life.
Remark 2:
Thank you a lot for great work on this excellent client! ;)