Avoid using IPv6 ULA for outgoing connections #14974

Open
opened 2026-02-22 01:38:02 -05:00 by deekerman · 4 comments
Owner

Originally created by @Pentium4User on GitHub (Sep 19, 2023).

qBittorrent & operating system versions

qBittorrent: 4.5.5-1 amd64
Operating system: Debian Sid
Qt: 6.4.2
libtorrent-rasterbar: 2.0.9-2

What is the problem?

Hello!
qBittorrent uses the IPv6 ULA address to connect to other GUA addresses (from 2000::/3, public IPv6 internet).
This has the result that answers will never ever reach me because IPv6 ULA isn't intended for communication in the internet.
qBittorrent should always use the IPv6 GUA address of the PC when connecting to another GUA and use ULA only for local peers that also have an ULA address.

Steps to reproduce

In Advanced settings, enable to bind to all IPv6 addresses, system must have additional ULA addresses.
Start downloading a torrent and use ss -utn to see the outgoing connections to GUA addresses form the ULA address.

Additional context

No response

Log(s) & preferences file(s)

No response

Originally created by @Pentium4User on GitHub (Sep 19, 2023). ### qBittorrent & operating system versions qBittorrent: 4.5.5-1 amd64 Operating system: Debian Sid Qt: 6.4.2 libtorrent-rasterbar: 2.0.9-2 ### What is the problem? Hello! qBittorrent uses the IPv6 ULA address to connect to other GUA addresses (from 2000::/3, public IPv6 internet). This has the result that answers will never ever reach me because IPv6 ULA isn't intended for communication in the internet. qBittorrent should always use the IPv6 GUA address of the PC when connecting to another GUA and use ULA only for local peers that also have an ULA address. ### Steps to reproduce In Advanced settings, enable to bind to all IPv6 addresses, system must have additional ULA addresses. Start downloading a torrent and use ss -utn to see the outgoing connections to GUA addresses form the ULA address. ### Additional context _No response_ ### Log(s) & preferences file(s) _No response_
Author
Owner

@Balls0fSteel commented on GitHub (Sep 19, 2023):

I found this:

bool QHostAddress::isSiteLocal() const

https://doc.qt.io/qt-6/qhostaddress.html

Guess when it enumerates the addresses/picks one, it could just ignore if the address is local. Just an idea.

@Balls0fSteel commented on GitHub (Sep 19, 2023): I found this: `bool QHostAddress::isSiteLocal() const` https://doc.qt.io/qt-6/qhostaddress.html Guess when it enumerates the addresses/picks one, it could just ignore if the address is local. Just an idea.
Author
Owner

@Pentium4User commented on GitHub (Sep 19, 2023):

Good point, that is fec0::/10. This must not be used when connecting to GUA (2000::/3).
bool QHostAddress::isUniqueLocalUnicast() looks good to find ULA (fc00::/7).
Maybe also check for link-local and loopback to also avoid using them.

It would be nice if you could implement these checks.

@Pentium4User commented on GitHub (Sep 19, 2023): Good point, that is fec0::/10. This must not be used when connecting to GUA (2000::/3). bool QHostAddress::isUniqueLocalUnicast() looks good to find ULA (fc00::/7). Maybe also check for link-local and loopback to also avoid using them. It would be nice if you could implement these checks.
Author
Owner

@Chocobo1 commented on GitHub (Oct 3, 2023):

Some findings:

In Advanced settings, enable to bind to all IPv6 addresses, system must have additional ULA addresses.

In this case, qbt will merely pass the string [::]:<port number> to listen_interfaces and it seems libtorrent handles the rest (routing, etc).

@arvidn
Any thoughts?

@Chocobo1 commented on GitHub (Oct 3, 2023): Some findings: >In Advanced settings, enable to bind to all IPv6 addresses, system must have additional ULA addresses. In this case, qbt will merely pass the string `[::]:<port number>` to [`listen_interfaces`](https://www.libtorrent.org/single-page-ref.html#listen_interfaces) and it seems libtorrent handles the rest (routing, etc). @arvidn Any thoughts?
Author
Owner

@Pentium4User commented on GitHub (May 29, 2024):

As the libtorrent tag was added, did someone already reported it there?

@Pentium4User commented on GitHub (May 29, 2024): As the libtorrent tag was added, did someone already reported it there?
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#14974
No description provided.