Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

dat doctor ignores --port #20

Open
da2x opened this issue May 4, 2019 · 3 comments
Open

dat doctor ignores --port #20

da2x opened this issue May 4, 2019 · 3 comments

Comments

@da2x
Copy link

da2x commented May 4, 2019

I am reporting: a bug or unexpected behavior

Bug Report

  1. Enable a system firewall that blocks all incoming connections. You know, like the one you’d find by default in most Linux server distributions and even some desktop distros.
  2. Open port 8989 and allow UDP and TCP connections to that port in the firewall.
  3. Run dat doctor --port 8989 and select the peer-to-peer test
  • Operating system: Fedora 30
  • Node Version: 10.15.3
  • Dat Version: 13.13.0

Expected behavior

Should use the specified port as it’s the only one that allows incoming connections.

Output to include: Your address is: <your-ip>:8989

Actual behavior

Output includes: Your address is: <your-ip>:<random-port>

@joehand joehand transferred this issue from dat-ecosystem/dat May 7, 2019
@joehand
Copy link
Collaborator

joehand commented May 7, 2019

Just to verify, this does not happen on the basic tests?

@joehand
Copy link
Collaborator

joehand commented May 7, 2019

We should maybe put something like this directly in discovery-swarm: https://github.com/datproject/dat-doctor/blob/master/lib/public-test.js#L28-L33

@Jamesse-Git
Copy link

I think it's a misunderstanding due to the log message.
The message Your address is:<your-ip>:<random-port> is realated to the public DNS discovery test.

So the random port you see is the port used to test the DNS connectivity with discovery1.datprotocol.com. It's not the listener port on you local OS.

Exemple:

First I open a dat-doctor:

[jamesse@datjamesse recup]$ dat doctor --port 64780
...
Your address is: XX.XX.XX.XX:46679`

After checking the listening port:

[root@datjamesse ~]# lsof -i | grep dat | grep 64780
dat 13977 jamesse 14u IPv6 109683 0t0 TCP *:64780 (LISTEN)
dat 13977 jamesse 15u IPv4 109684 0t0 UDP *:64780
[root@datjamesse ~]# lsof -i | grep dat | grep 46679
[root@datjamesse ~]#

You could see the listening port is ok.
It's a "wording issue" in the log message: Your address is: XX.XX.XX.XX:46679
We could:

  • change by "Your address used to test public DNS connectivity:"
  • remove the port information because I think in this case there is no reason to show this port
  • add another log message when the peer-to-peer test start. in order to dispaly the listening port

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

No branches or pull requests

3 participants