Open chgans opened 3 years ago
Using stable PPA, the problem is gone, but another shows up :( qBittorrent v4.3.3 (server)
chgans@chgans-laptop:~/tmp$ sudo netstat -ltupn | grep torr
tcp 0 0 169.254.1.1:49025 0.0.0.0:* LISTEN 9807/qbittorrent
tcp6 0 0 :::9000 :::* LISTEN 9807/qbittorrent
udp 0 0 169.254.1.1:49025 0.0.0.0:* 9807/qbittorrent
torrent-rasterbar 1.2.13 (client)
chgans@chgans-laptop:~/tmp$ sudo netstat -ltupn | grep burn
tcp 0 0 169.254.1.1:6881 0.0.0.0:* LISTEN 9689/neon-burn-in-c
udp 0 0 169.254.1.1:6881 0.0.0.0:* 9689/neon-burn-in-c
Logs on server side:
(N) 2021-03-16T10:40:20 - qBittorrent v4.3.3 started
(N) 2021-03-16T10:40:20 - Using config directory: /home/chgans/.config/qBittorrent/
(I) 2021-03-16T10:40:20 - Trying to listen on: 169.254.1.1:49025
(N) 2021-03-16T10:40:20 - Peer ID: -qB4330-
(N) 2021-03-16T10:40:20 - HTTP User-Agent is 'qBittorrent/4.3.3'
(I) 2021-03-16T10:40:20 - DHT support [OFF]
(I) 2021-03-16T10:40:20 - Local Peer Discovery support [OFF]
(I) 2021-03-16T10:40:20 - PeX support [OFF]
(I) 2021-03-16T10:40:20 - Anonymous mode [OFF]
(I) 2021-03-16T10:40:20 - Encryption support [ON]
(I) 2021-03-16T10:40:20 - Embedded Tracker: Now listening on IP: 0.0.0.0, port: 9000
(N) 2021-03-16T10:40:20 - Options were saved successfully.
(I) 2021-03-16T10:40:20 - Successfully listening on IP: 169.254.1.1, port: TCP/49025
(I) 2021-03-16T10:40:20 - Successfully listening on IP: 169.254.1.1, port: UDP/49025
(N) 2021-03-16T10:40:20 - 'XXX' restored.
(N) 2021-03-16T10:40:20 - 'YYY' restored.
etc..
Logs on client side:
Go7 Manuals v3.0: [1000] 0 0 0 0 0 0 0 0 0 0
Go7 Manuals v3.0: [1000] 0 0 0 0 0 0 0 0 0 0
Go7 Manuals v3.0: *** UPDATE LIST [ torrent_want_tick : 0 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] >>> OUTGOING_CONNECTION [ ep: 169.254.1.1:49025 type: uTP seed: 0 p: 0x7f279c0111e0 local: 0.0.0.0:0 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] *** CONSTRUCT [ bt_peer_connection ]
Go7 Manuals v3.0: *** UPDATE LIST [ torrent_want_peers_download : 0 ]
Go7 Manuals v3.0: *** UPDATE LIST [ torrent_want_tick : 1 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] *** SET_PEER_CLASS [ a: 169.254.1.1 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] *** CLASS [ local ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] >>> OPEN [ protocol: IPv4 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] >>> BIND [ dst: 169.254.1.1:6881 ec: Success ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] >>> ASYNC_CONNECT [ dst: 169.254.1.1:49025 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] connecting to peer (uTP)
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] *** LOCAL ENDPOINT [ e: 169.254.1.1:6881 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] <<< CANNOT_READ [ quota: 104 can-write-to-disk: yes queue-limit: 1048576 disconnecting: no connecting: yes ]
RECALCULATE UNCHOKE SLOTS: [ peers: 1 eligible-peers: 0 allowed-slots: 8 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] >>> COMPLETED [ ep: 169.254.1.1:49025 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] *** SET_NON_BLOCKING [ ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] >>> SET_TOS [ tos: 32 e: Success ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] *** ENCRYPTION [ outgoing encryption policy: enabled ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] ==> EXTENSIONS [ 0000000000000000000000000000000000000000000110000000000000000101 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] >>> HANDSHAKE [ sent peer_id: 2d4c54313243302d354364482d6b6b3864675921 client: libtorrent 1.2.12 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] ==> HANDSHAKE [ ih: ae17962550eac1af603c34622d098ae0fecd3f4a ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] >>> CORKED_WRITE [ bytes: 68 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] <<< ASYNC_READ [ max: 104 bytes ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] >>> ASYNC_WRITE [ bytes: 68 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] >>> CORKED_WRITE [ bytes: 68 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] *** ON_SEND_DATA [ bytes: 68 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] >>> WROTE [ 68 bytes ]
Go7 Manuals v3.0: [1000] 0 68 0 0 120 0 0 80 0 0
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] <<< ON_RECEIVE_DATA [ bytes: 0 ERROR: (asio.misc:2) End of file ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] *** ERROR [ in peer_connection::on_receive_data_impl ERROR: (asio.misc:2) End of file ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] *** CLOSE_REASON [ 5 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] *** CONNECTION_CLOSED [ op: 11 ERROR: (asio.misc:2) End of file ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] disconnecting (uTP) [sock_read] [asio.misc]: End of file (reason: 5)
Go7 Manuals v3.0: *** UPDATE LIST [ torrent_want_peers_download : 1 ]
Go7 Manuals v3.0 peer [ 169.254.1.1:49025 client: Unknown ] [169.254.1.1:49025] *** CONNECTION CLOSED [ ]
Go7 Manuals v3.0: [1000] 0 0 0 0 0 0 0 0 0 0
Go7 Manuals v3.0: [1000] 0 0 0 0 0 0 0 0 0 0
OK, so it looks like this is an edge case, running 2 clients on the same ip address/interface but different ports, upset libtorrent-rasterbar. With this change to the client:
settings.set_str(lt::settings_pack::listen_interfaces,
"192.168.1.64:6881");
settings.set_str(lt::settings_pack::outgoing_interfaces,
"");
Client can get data from server, but still cannot share with other devices on 169.254.0.0/16.
qBittorrent version and Operating System
Acting as server: Stock qBittorrent 4.03, Qt 5.9, libtorrent-rasterbar 1.1.5 on KUbuntu 18.04 Problematic client, very simple test app using libtorrent-rasterbar v2.0.2, no Qt, test app is running on same host, using same address, but different port.
What is the problem
The client cannot connect to peer once tracker announce is done:
What is the expected behavior
Client should connect to peer on 169.254.1.1:8999, and peer 169.254.6.197:6881 (another device on the network)
Steps to reproduce
Fire qBittorrent, enable integrated tracker, set listen interface/address, initialise with data/torrent so that qBittorrent is ready for seeding
Run client:
Extra info(if any)
This is a multi-home setup, where torrent nodes should only talk locally on a dedicated interface which is configured as 169.254.1.1 (Link local IPv4).
Looking at libtorrent code, it seems that problem start somewhere around in torrent.cpp.
torrent::tracker_response()
and end up in
torrent::on_peer_name_lookup()
, where the "name-lookup add_peer()" log is produced.