Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listen_interfaces and tracker_errors. #7704

Open
i96751414 opened this issue Jul 8, 2024 · 3 comments
Open

listen_interfaces and tracker_errors. #7704

i96751414 opened this issue Jul 8, 2024 · 3 comments

Comments

@i96751414
Copy link

libtorrent version (or branch):
1.2.19

platform/architecture:
Linux arm64

Hi @arvidn,

I have one question that is puzzling me a bit. I have been using libtorrent for years and never had to configure listen_interfaces for it to work - the default value has been working so far.

Recently I started doing some tests with libtorrent on a RPi 5 and it simply doesn't work with the default values. I see a lot of 'tracker_errors' with "Host not found (non-authoritative)" although I have 'listen_succeeded' alert. At first glance I thought it would be a DNS problem, but it is not. If I set my local IP address (192.168.1.x) in listen_interfaces it starts working; If i set the device name (wlan0) it doesn't work (in this case I don't even receive a 'listen_succeeded/failed' alert). What could be the reason for this? Might it be related with my local network configuration?

Thanks in advance!

@i96751414
Copy link
Author

After some testing I realised libtorrent is not able to see my interfaces. The bellow code produces the following output:

    libtorrent::io_service ioContext;
    libtorrent::error_code errorCode;
    auto ifaces = libtorrent::enum_net_interfaces(ioContext, errorCode);
    for (auto &iface : ifaces)
        std::cout << iface.name << " : " << iface.interface_address << std::endl;

output:

lo : 127.0.0.1
lo : ::1

wlan0 is not listed here... Not sure if this is intended?
I can workaround this by adding code to find interfaces and their IPs at my end, but it would be nice to have libtorrent doing it.

@arvidn
Copy link
Owner

arvidn commented Jul 23, 2024

could you try building and running the enum_if test program? e.g.

cd tests
b2 link=static stage_enum_if
./enum_if

It prints something like this:

=========== Routes ===========
destination                                  network                                      gateway                            mtu    source-hint       interface
0.0.0.0                                      0.0.0.0                                      192.168.12.1                       0      -                 en0
127.0.0.0                                    255.0.0.0                                    127.0.0.1                          0      127.0.0.1         lo0
========= Interfaces =========
address                           netmask                                      name                gateway             state          flags               description
127.0.0.1                         255.0.0.0                                    lo0                 -                   unknown        UP LOOP RUN MULTICAST
::1                               ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff      lo0                 -                   unknown        UP LOOP RUN MULTICAST
fe80::1%lo0                       ffff:ffff:ffff:ffff::                        lo0                 -                   unknown        UP LOOP RUN MULTICAST
fe80::a078:17ff:fe8a:d838%ap1     ffff:ffff:ffff:ffff::                        ap1                 -                   unknown        UP BROADCAST RUN MULTICAST
fe80::14d1:8a1:79c3:4d62%en0      ffff:ffff:ffff:ffff::                        en0                 -                   unknown        UP BROADCAST RUN MULTICAST
192.168.12.27                     255.255.255.0                                en0                 192.168.12.1        unknown        UP BROADCAST RUN MULTICAST
fe80::488:7fff:fe44:9732%awdl0    ffff:ffff:ffff:ffff::                        awdl0               -                   unknown        UP BROADCAST RUN MULTICAST
fe80::488:7fff:fe44:9732%llw0     ffff:ffff:ffff:ffff::                        llw0                -                   unknown        UP BROADCAST RUN MULTICAST

@i96751414
Copy link
Author

This is the result I have on 2.0.10 and 1.2.19:

=========== Routes ===========
destination                                  network                                      gateway                            mtu    source-hint       interface
0.0.0.0                                      0.0.0.0                                      192.168.1.254                      1500   -                 wlan0
192.168.1.0                                  255.255.255.0                                -                                  1500   192.168.1.139     wlan0
127.0.0.0                                    255.0.0.0                                    -                                  65536  127.0.0.1         lo
127.0.0.1                                    255.255.255.255                              -                                  65536  127.0.0.1         lo
127.255.255.255                              255.255.255.255                              -                                  65536  127.0.0.1         lo
192.168.1.139                                255.255.255.255                              -                                  1500   192.168.1.139     wlan0
192.168.1.255                                255.255.255.255                              -                                  1500   192.168.1.139     wlan0
2001:8a0:e4ba:4901::                         ffff:ffff:ffff:ffff::                        -                                  1500   -                 wlan0
2001:8a0:e4ba:4900::                         ffff:ffff:ffff:ff00::                        fe80::a691:b1ff:fef0:dd9c%wlan0    1500   -                 wlan0
fe80::                                       ffff:ffff:ffff:ffff::                        -                                  1500   -                 wlan0
::                                           ::                                           fe80::a691:b1ff:fef0:dd9c%wlan0    1500   -                 wlan0
::1                                          ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff      -                                  65536  -                 lo
2001:8a0:e4ba:4901:53f0:408d:1c7e:5063       ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff      -                                  1500   -                 wlan0
fe80::3b56:58fa:517a:8387                    ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff      -                                  1500   -                 wlan0
ff00::                                       ff00::                                       -                                  1500   -                 wlan0
========= Interfaces =========
address                           netmask                                      name                gateway             state          flags               description
127.0.0.1                         255.0.0.0                                    lo                  -                   unknown        UP LOOP RUN          
::1                               ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff      lo                  -                   unknown        UP LOOP RUN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants