4.2.0 not sending IPv6 parameter to announce #9380

Closed
opened 2026-02-21 20:08:54 -05:00 by deekerman · 29 comments
Owner

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:

  • 4.2.0
  • 4.2.0RC
  • 4.2.0beta1

Versions correctly sending IPv6 address:

  • 4.2.0alpha2
  • 4.1.9

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 IPaddrOfAnnounce or 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:

23:38:39.734908 IP 192.168.10.200.53131 > sometrackerIP.http: Flags [P.], seq 1:405, ack 1, win 4096, length 404: HTTP: GET /announce.php?pid=REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200-bPOMyo4X8kI&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=90A4C02D&event=started&numwant=200&compact=1&no_peer_id=1&supportcrypto=1&redundant=0 HTTP/1.1
E.....@.@.....
.h.=....P....!#I.P...s&..GET /announce.php?pid= REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200-bPO
Myo4X8kI&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=90A4C02D&event=started&numwant=200&compact=1&no_peer_id=1&supportcrypto=1&redundant=0 HTTP/1.1
Host: announce.REDACTED.net
User-Agent: qBittorrent/4.2.0
Accept-Encoding: gzip
Connection: close

TCPDUMP capture of v4.2.0RC:

01:34:32.479839 IP 192.168.10.200.54947 > sometrackerIP.http: Flags [P.], seq 1:408, ack 1, win 4096, length 407: HTTP: GET /announce.php?pid=REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200-*Ib!q(~aXR_A&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=C40300FC&event=stopped&numwant=0&compact=1&no_peer_id=1&supportcrypto=1&redundant=1503 HTTP/1.1
E.....@.@.....
.h.<....P...T+c..P...r)..GET /announce.php?pid=REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200-*Ib!q(~aXR_A&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=C40300FC&event=stopped&numwant=0&compact=1&no_peer_id=1&supportcrypto=1&redundant=1503 HTTP/1.1
Host: announce.REDACTED.net
User-Agent: qBittorrent/4.2.0RC
Accept-Encoding: gzip
Connection: close

TCPDUMP capture of v4.2.0beta1:

01:38:08.352097 IP 192.168.10.200.55010 > sometrackerIP.http: Flags [P.], seq 1:408, ack 1, win 4096, length 407: HTTP: GET /announce.php?pid=REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200--5v-m_nL9FZ.&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=B4ACD7B1&event=stopped&numwant=0&compact=1&no_peer_id=1&supportcrypto=1&redundant=0 HTTP/1.1
E.....@.@.....
.h.=....P.A`.._27P...s)..GET /announce.php?pid=REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200--5v-m_nL9FZ.&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=B4ACD7B1&event=stopped&numwant=0&compact=1&no_peer_id=1&supportcrypto=1&redundant=0 HTTP/1.1
Host: announce.REDACTED.net
User-Agent: qBittorrent/4.2.0beta1
Accept-Encoding: gzip
Connection: close

TCPDUMP capture of v4.2.0alpha2:

23:49:10.881417 IP 192.168.10.200.53685 > sometrackerIP.http: Flags [P.], seq 1:466, ack 1, win 4096, length 465: HTTP: GET /announce.php?pid=REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200-41kdDXc5MMZm&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=86031599&event=started&numwant=200&compact=1&no_peer_id=1&supportcrypto=1&redundant=0&ipv6=2a01%3ab380%3a400%3a11%3a841%3a1cd2%3a6037%3a77e8 HTTP/1.1
E.....@.@.....
.h.<....P......miP...rc..GET /announce.php?pid= REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200-41kdDXc5MMZm&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=86031599&event=started&numwant=200&compact=1&no_peer_id=1&supportcrypto=1&redundant=0&ipv6=2a01%3ab380%3a400%3a11%3a841%3a1cd2%3a6037%3a77e8 HTTP/1.1
Host: announce.REDACTED.net
User-Agent: qBittorrent/4.2.0alpha2
Accept-Encoding: gzip
Connection: close

TCPDUMP capture of v4.1.9:

02:01:00.600593 IP 192.168.10.200.55299 > 104.18.61.245.http: Flags [P.], seq 1:458, ack 1, win 4096, length 457: HTTP: GET /announce.php?pid= REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4190-Xp.u7Vuux-t!&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=7A3594D5&event=stopped&numwant=0&compact=1&no_peer_id=1&supportcrypto=1&redundant=0&ipv6=2a01%REDACTED%3a77e8 HTTP/1.1
E.....@.@.....
.h.=....P.(>.....P...s[..GET /announce.php?pid= REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4190-Xp.u7Vuux-t!&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=7A3594D5&event=stopped&numwant=0&compact=1&no_peer_id=1&supportcrypto=1&redundant=0&ipv6=2a01%REDACTED%3a77e8 HTTP/1.1
Host: announce. REDACTED.net
User-Agent: qBittorrent/4.1.9
Accept-Encoding: gzip
Connection: close

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: - 4.2.0 - 4.2.0RC - 4.2.0beta1 #### Versions correctly sending IPv6 address: - 4.2.0alpha2 - 4.1.9 ### 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 IPaddrOfAnnounce` or 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:** >23:38:39.734908 IP 192.168.10.200.53131 > sometrackerIP.http: Flags [P.], seq 1:405, ack 1, win 4096, length 404: HTTP: GET /announce.php?pid=REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200-bPO*Myo4X8kI&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=90A4C02D&event=started&numwant=200&compact=1&no_peer_id=1&supportcrypto=1&redundant=0 HTTP/1.1 >E.....@.@..... >.h.=....P....!#I.P...s&..GET /announce.php?pid= REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200-bPO*Myo4X8kI&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=90A4C02D&event=started&numwant=200&compact=1&no_peer_id=1&supportcrypto=1&redundant=0 HTTP/1.1 Host: announce.REDACTED.net User-Agent: qBittorrent/4.2.0 Accept-Encoding: gzip Connection: close **TCPDUMP capture of v4.2.0RC:** >01:34:32.479839 IP 192.168.10.200.54947 > sometrackerIP.http: Flags [P.], seq 1:408, ack 1, win 4096, length 407: HTTP: GET /announce.php?pid=REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200-*Ib!q(~aXR_A&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=C40300FC&event=stopped&numwant=0&compact=1&no_peer_id=1&supportcrypto=1&redundant=1503 HTTP/1.1 >E.....@.@..... >.h.<....P...T+c..P...r)..GET /announce.php?pid=REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200-*Ib!q(~aXR_A&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=C40300FC&event=stopped&numwant=0&compact=1&no_peer_id=1&supportcrypto=1&redundant=1503 HTTP/1.1 Host: announce.REDACTED.net User-Agent: qBittorrent/4.2.0RC Accept-Encoding: gzip Connection: close **TCPDUMP capture of v4.2.0beta1:** >01:38:08.352097 IP 192.168.10.200.55010 > sometrackerIP.http: Flags [P.], seq 1:408, ack 1, win 4096, length 407: HTTP: GET /announce.php?pid=REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200--5v-m_nL9FZ.&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=B4ACD7B1&event=stopped&numwant=0&compact=1&no_peer_id=1&supportcrypto=1&redundant=0 HTTP/1.1 >E.....@.@..... >.h.=....P.A`.._27P...s)..GET /announce.php?pid=REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200--5v-m_nL9FZ.&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=B4ACD7B1&event=stopped&numwant=0&compact=1&no_peer_id=1&supportcrypto=1&redundant=0 HTTP/1.1 Host: announce.REDACTED.net User-Agent: qBittorrent/4.2.0beta1 Accept-Encoding: gzip Connection: close **TCPDUMP capture of v4.2.0alpha2:** > 23:49:10.881417 IP 192.168.10.200.53685 > sometrackerIP.http: Flags [P.], seq 1:466, ack 1, win 4096, length 465: HTTP: GET /announce.php?pid=REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200-41kdDXc5MMZm&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=86031599&event=started&numwant=200&compact=1&no_peer_id=1&supportcrypto=1&redundant=0&ipv6=2a01%3ab380%3a400%3a11%3a841%3a1cd2%3a6037%3a77e8 HTTP/1.1 > E.....@.@..... >.h.<....P......miP...rc..GET /announce.php?pid= REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4200-41kdDXc5MMZm&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=86031599&event=started&numwant=200&compact=1&no_peer_id=1&supportcrypto=1&redundant=0&ipv6=2a01%3ab380%3a400%3a11%3a841%3a1cd2%3a6037%3a77e8 HTTP/1.1 Host: announce.REDACTED.net User-Agent: qBittorrent/4.2.0alpha2 Accept-Encoding: gzip Connection: close **TCPDUMP capture of v4.1.9:** >02:01:00.600593 IP 192.168.10.200.55299 > 104.18.61.245.http: Flags [P.], seq 1:458, ack 1, win 4096, length 457: HTTP: GET /announce.php?pid= REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4190-Xp.u7Vuux-t!&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=7A3594D5&event=stopped&numwant=0&compact=1&no_peer_id=1&supportcrypto=1&redundant=0&ipv6=2a01%REDACTED%3a77e8 HTTP/1.1 >E.....@.@..... >.h.=....P.(>.....P...s[..GET /announce.php?pid= REDACTED&info_hash=%a0%c0bLRh%00%8d%3f%7cY%40%abX%8b%a8%a8b%04k&peer_id=-qB4190-Xp.u7Vuux-t!&port=45557&uploaded=0&downloaded=0&left=259950586&corrupt=0&key=7A3594D5&event=stopped&numwant=0&compact=1&no_peer_id=1&supportcrypto=1&redundant=0&ipv6=2a01%REDACTED%3a77e8 HTTP/1.1 Host: announce. REDACTED.net User-Agent: qBittorrent/4.1.9 Accept-Encoding: gzip Connection: close
Author
Owner

@QuintonQu commented on GitHub (Dec 3, 2019):

I got the same problem.

@QuintonQu commented on GitHub (Dec 3, 2019): I got the same problem.
Author
Owner

@jjbot-0 commented on GitHub (Dec 3, 2019):

I got the same problem.

everyone has the same. What is your OS and version, pls?

@jjbot-0 commented on GitHub (Dec 3, 2019): > I got the same problem. everyone has the same. What is your OS and version, pls?
Author
Owner

@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.

@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.
Author
Owner

@jjbot-0 commented on GitHub (Dec 3, 2019):

looks like a huge difference to me...

@jjbot-0 commented on GitHub (Dec 3, 2019): looks like a huge difference to me...
Author
Owner

@QuintonQu commented on GitHub (Dec 4, 2019):

I got the same problem.

everyone has the same. What is your OS and version, pls?

MacOS Catalina 15.1

@QuintonQu commented on GitHub (Dec 4, 2019): > > I got the same problem. > > everyone has the same. What is your OS and version, pls? MacOS Catalina 15.1
Author
Owner

@Krles commented on GitHub (Dec 4, 2019):

I got the same problem.
4.2.0 final (Windows 10 version1909 64-bit)

@Krles commented on GitHub (Dec 4, 2019): I got the same problem. 4.2.0 final (Windows 10 version1909 64-bit)
Author
Owner

@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).

@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).
Author
Owner

@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.99201911190849-6738-0b055d8ubuntu18.04.1
which this works as described
unstable = 4.2.0201912040848-6798-2e8b17eubuntu18.04.1
but actually it is v4.3.0alpha1 (using libtorrent 1.2), and also does not send ipv6 address.

@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-0b055d8~ubuntu18.04.1 which this works as described unstable = 4.2.0~201912040848-6798-2e8b17e~ubuntu18.04.1 but actually it is v4.3.0alpha1 (using libtorrent 1.2), and also does not send ipv6 address.
Author
Owner

@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_mode to false. Then it will be included in announces for private torrents.

@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_mode` to false. Then it will be included in announces for *private* torrents.
Author
Owner

@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_mode is 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.0 is opened for listening, but not [::]?

@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_mode` is false by default in libtorrent. The current logic (in 1.2.x) can be found [here](https://github.com/arvidn/libtorrent/blob/RC_1_2/src/torrent.cpp#L2879). 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.0` is opened for listening, but not `[::]`?
Author
Owner

@jjbot-0 commented on GitHub (Dec 4, 2019):

@arvidn

Is it possible that perhaps a change is that only 0.0.0.0 is opened for listening, but not [::]

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.

@jjbot-0 commented on GitHub (Dec 4, 2019): @arvidn >Is it possible that perhaps a change is that only 0.0.0.0 is opened for listening, but not [::] 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.
Author
Owner

@sledgehammer999 commented on GitHub (Dec 4, 2019):

@jjbot-0

  1. Have you disabled anonymous mode? (Tools->Options->Bittorrent->Privacy->Enable Anonymous mode)
  2. Is your torrent a private torrent?
@sledgehammer999 commented on GitHub (Dec 4, 2019): @jjbot-0 1. Have you disabled anonymous mode? (Tools->Options->Bittorrent->Privacy->Enable Anonymous mode) 2. Is your torrent a private torrent?
Author
Owner

@arvidn commented on GitHub (Dec 4, 2019):

there's a subtle change in how the listen_interfaces setting 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 to INADDR_ANY) but also an IPv6 socket would be opened.

in libtorrent-1.2, if you listen to 0.0.0.0:6881 only the IPv4 INADDR_ANY is opened as a listen socket. If you want to listen to both IPv4 and IPv6, you need to listen to 0.0.0.0:6881,[::]:6881.

@arvidn commented on GitHub (Dec 4, 2019): there's a subtle change in how the `listen_interfaces` setting 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 to `INADDR_ANY`) but also an IPv6 socket would be opened. in libtorrent-1.2, if you listen to `0.0.0.0:6881` *only* the IPv4 `INADDR_ANY` is opened as a listen socket. If you want to listen to both IPv4 and IPv6, you need to listen to `0.0.0.0:6881,[::]:6881`.
Author
Owner

@jjbot-0 commented on GitHub (Dec 4, 2019):

@sledgehammer999

  1. anonymous mode is disabled
  2. torrent is private
@jjbot-0 commented on GitHub (Dec 4, 2019): @sledgehammer999 1. anonymous mode is disabled 2. torrent is private
Author
Owner

@sledgehammer999 commented on GitHub (Dec 4, 2019):

if you want to listen to both IPv4 and IPv6, you need to listen to 0.0.0.0:6881,[::]:6881.

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.

@sledgehammer999 commented on GitHub (Dec 4, 2019): >if you want to listen to both IPv4 and IPv6, you need to listen to 0.0.0.0:6881,[::]:6881. 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.
Author
Owner

@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. ;)

@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. ;)
Author
Owner

@p43b1 commented on GitHub (Dec 4, 2019):

@arvidn could be this issue related to # #3601 that, despite the status, is still unsolved?

@p43b1 commented on GitHub (Dec 4, 2019): @arvidn could be this issue related to # #3601 that, despite the status, is still unsolved?
Author
Owner

@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?

@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?
Author
Owner

@p43b1 commented on GitHub (Dec 4, 2019):

@p43b1 it could, but I don't think so. Are you experiencing that issue with a recent qBittorrent?

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

@p43b1 commented on GitHub (Dec 4, 2019): > > > @p43b1 it could, but I don't think so. Are you experiencing that issue with a recent qBittorrent? 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
Author
Owner

@arvidn commented on GitHub (Dec 4, 2019):

@p43b1 please post in ticket #3601 instead of here

@arvidn commented on GitHub (Dec 4, 2019): @p43b1 please post in ticket #3601 instead of here
Author
Owner

@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 addresses in the qbittorrent advanced settings)
The diff applied on top of v4.2.0 (912b076707):

diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp
index 1c4e854de..df4462030 100644
--- a/src/base/bittorrent/session.cpp
+++ b/src/base/bittorrent/session.cpp
@@ -1254,12 +1254,13 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack)
 
         for (const QString &ip : asConst(getListeningIPs())) {
             if (ip.isEmpty()) {
-                const QString anyIP = QHostAddress(QHostAddress::AnyIPv4).toString();
-                const std::string endpoint = anyIP.toStdString() + ':' + std::to_string(port);
+                const QString anyIPv4 = QHostAddress(QHostAddress::AnyIPv4).toString();
+                const QString anyIPv6 = QHostAddress(QHostAddress::AnyIPv6).toString();
+                const std::string endpoint = anyIPv4.toStdString() + ':' + std::to_string(port)
+                                             + ",[" + anyIPv6.toStdString() + "]:" + std::to_string(port);
                 settingsPack.set_str(lt::settings_pack::listen_interfaces, endpoint);
-                LogMsg(tr("Trying to listen on IP: %1, port: %2"
-                        , "e.g: Trying to listen on IP: 192.168.0.1, port: 6881")
-                        .arg(anyIP, QString::number(port))
+                LogMsg(tr("Trying to listen on: %1", "e.g: Trying to listen on: 192.168.0.1:6881")
+                        .arg(endpoint.c_str())
                     , Log::INFO);
                 break;
             }
@sledgehammer999 commented on GitHub (Dec 4, 2019): @jjbot-0 please try this test build: [link](http://builds.shiki.hu/temp/qbittorrent_4.2.0_x64_patched_for_issue_11561.7z) (run from any folder or replace original files) This affects how the default interface is set. (`Any interface` + `All addresses` in the qbittorrent advanced settings) The diff applied on top of v4.2.0 (912b0767071f56464): ```diff diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 1c4e854de..df4462030 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -1254,12 +1254,13 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack) for (const QString &ip : asConst(getListeningIPs())) { if (ip.isEmpty()) { - const QString anyIP = QHostAddress(QHostAddress::AnyIPv4).toString(); - const std::string endpoint = anyIP.toStdString() + ':' + std::to_string(port); + const QString anyIPv4 = QHostAddress(QHostAddress::AnyIPv4).toString(); + const QString anyIPv6 = QHostAddress(QHostAddress::AnyIPv6).toString(); + const std::string endpoint = anyIPv4.toStdString() + ':' + std::to_string(port) + + ",[" + anyIPv6.toStdString() + "]:" + std::to_string(port); settingsPack.set_str(lt::settings_pack::listen_interfaces, endpoint); - LogMsg(tr("Trying to listen on IP: %1, port: %2" - , "e.g: Trying to listen on IP: 192.168.0.1, port: 6881") - .arg(anyIP, QString::number(port)) + LogMsg(tr("Trying to listen on: %1", "e.g: Trying to listen on: 192.168.0.1:6881") + .arg(endpoint.c_str()) , Log::INFO); break; } ```
Author
Owner

@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

@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
Author
Owner

@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.

@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.
Author
Owner

@arvidn commented on GitHub (Dec 5, 2019):

@sledgehammer999 Do I understand correctly that the issue was that the default listen_interfaces in qBT is 0.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.

@arvidn commented on GitHub (Dec 5, 2019): @sledgehammer999 Do I understand correctly that the issue was that the default `listen_interfaces` in qBT is `0.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.
Author
Owner

@Krles commented on GitHub (Dec 5, 2019):

Thank you.
It works correctly with the fix.

@Krles commented on GitHub (Dec 5, 2019): Thank you. It works correctly with the fix.
Author
Owner

@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 mention 0.0.0.0 only.
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.

@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 mention `0.0.0.0` only. 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.
Author
Owner

@jjbot-0 commented on GitHub (Dec 5, 2019):

thank you! @sledgehammer999

Patch for Mac will be released in next regular version, right?

@jjbot-0 commented on GitHub (Dec 5, 2019): thank you! @sledgehammer999 Patch for Mac will be released in next regular version, right?
Author
Owner

@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?

@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?
Author
Owner

@jjbot-0 commented on GitHub (Dec 5, 2019):

@sledgehammer999 tried any combination:

  • Any port / All adresses / All IPv4 / All IPv6 / specific IPv4 / specific IPv6
  • Specific port / All adresses / All IPv4 / All IPv6 / specific IPv4 / specific IPv6

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! ;)

@jjbot-0 commented on GitHub (Dec 5, 2019): @sledgehammer999 tried any combination: - **_Any_** port / All adresses / All IPv4 / All IPv6 / specific IPv4 / specific IPv6 - **_Specific_** port / All adresses / All IPv4 / All IPv6 / specific IPv4 / specific IPv6 **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! ;)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#9380
No description provided.