libtorrent sends port=0 via IPv6 announce instead of the correct port

Bug #1801164 reported by Tiger!P on 2018-11-01
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libtorrent-rasterbar (Ubuntu)
Undecided
Unassigned

Bug Description

This bug has also been reported to debian [1].

1) lsb_release -rd
Description: Ubuntu 18.10
Release: 18.10

2) dpkg -l | grep libtorrent
ii libtorrent-rasterbar9 1.1.9-1 amd64 C++ bittorrent library by Rasterbar Software
ii python-libtorrent 1.1.9-1 amd64 Python bindings for libtorrent-rasterbar

* What led up to the situation?

My system has both IPv4 and IPv6 connections and I used deluged with libtorrent to get the debian-9.5.0-amd64-netinst.iso .

* What exactly did you do (or not do) that was effective (or ineffective)?

When I did an update tracker, I saw that 2 announce messages are sent.
One to the tracker's IPv4 address and one to the tracker's IPv6 address, but the last one sent port=0 instead of the correct portnumber.
The order might change (first IPv6 and then IPv4).

* What was the outcome of this action?

I did a tcpdump of the connection to the debian tracker and saw the following data:

To 130.239.18.159 on port 6969:
..`.NGD.GET /announce?info_hash=%3b%1d%85%f8x%0e%f8%c4%d8S%8f%80%9azc%fcR%991%8e&peer_id=-DE13F0-a7HtrDr99EyW&port=28741&uploaded=0&downloaded=0&left=0&corrupt=0&key=EBA0497F&event=started&numwant=200&compact=1&no_peer_id=1&supportcrypto=1&redundant=0 HTTP/1.1
Host: bttracker.debian.org:6969
User-Agent: Deluge 1.3.15
Accept-Encoding: gzip
Connection: close

and to 2001:6b0:e:2018::159 on port 6969:
..5ENGD.GET /announce?info_hash=%3b%1d%85%f8x%0e%f8%c4%d8S%8f%80%9azc%fcR%991%8e&peer_id=-DE13F0-a7HtrDr99EyW&port=0&uploaded=0&downloaded=0&left=0&corrupt=0&key=EBA0497F&event=started&numwant=200&compact=1&no_peer_id=1&supportcrypto=1&redundant=0 HTTP/1.1
Host: bttracker.debian.org:6969
User-Agent: Deluge 1.3.15
Accept-Encoding: gzip
Connection: close

Here you can see the port=0 part of the announce message, which will make the tracker think the client is listening on port 0, but it is not.

* What outcome did you expect instead?
I would expect that both the IPv4 and IPv6 announce messages would send the correct port

* Additional information
This issue has also been reported to upstream as #3306 [2] and has been fixed with PR #3385 [3]. And it will be available in the next 1.1.X release.
I've added the patch that can be applied to fix the issue.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911107
[2] https://github.com/arvidn/libtorrent/issues/3306
[3] https://github.com/arvidn/libtorrent/pull/3385

Tiger!P (ubuntu-tigerp) wrote :

The attachment "fix the port=0 issue" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Tiger!P (ubuntu-tigerp) wrote :

This bug has been fixed in the new upstream release 1.1.11 [1].

[1] https://github.com/arvidn/libtorrent/releases/tag/libtorrent_1_1_11

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers