Skip to content

Conversation

@pljones
Copy link
Collaborator

@pljones pljones commented May 28, 2022

Short description of changes

I'm hoping this change at least clarifies what's meant to happen with the more complicated client/server/directory trios, i.e. where one or other - or both - of the client and server are local to the directory itself.

CHANGELOG: Refactoring: Handling of requests for the server list.

Context: Fixes an issue?

Not that I can remember.

Does this change need documentation? What needs to be documented and how?

Should be noticeable in most situations and I don't think we document at this level of detail.

Status of this Pull Request

My directories run with it (at seem to get used). It's not fixed anything or broken anything as far as I can tell.

What is missing until this pull request can be merged?

Someone else reading it and understanding it...

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@pljones pljones requested a review from softins May 28, 2022 17:36
@gene96817
Copy link

@pljones What is the internal/external IP issue that you are addressing? Since I am often supporting uses that trip over localIP/ExternalIP/NAT issues, I am interested in following the full range of issues. THX

@ann0see ann0see requested a review from hoffie May 29, 2022 06:09
@pljones
Copy link
Collaborator Author

pljones commented May 29, 2022

Think of a LAN behind an external router. (I'll not get into the router configuration for ports.)

Say the Directory is 10.0.1.23
Say the Server is 10.0.1.24

Say the external address of the router is 86.212.104.22

When an internal client wants the server IP, it wants 10.0.1.24

When an external client wants the server IP, it wants 86.212.104.22

Now say a server not on the LAN registers with an IP address of 37.141.86.185

When an internal (to the directory) client wants the server IP, it wants 37.141.86.185

When an external (to the directory) client wants the server IP, it wants ... what? Well... 37.141.86.185 if it's not internal to that server but it wants the server LAN address if it is.


I'm not certain what it used to do but I think mine's clearer.

@pljones pljones force-pushed the patch/rethink-int-ext-serverlist-entry branch from 7ceaa4c to e7ac4a2 Compare May 29, 2022 20:49
@gene96817
Copy link

@pljones If the person operating the servers is the only one using a client on the LAN, that person is technically savvy and they can choose whatever they like.

In my case, I want a solution for guest on my LAN. In this case, I want a solution were the guest (being less technically savvy) has the same user experience on my LAN as when connected to the external network. For this goal, I put routing table entries so that the router routes the external IP address to the matching local address.

In your example, an internal client would request 86.212.104.22 and the router will route the messages to 10.0.1.24.
Similar messages to 37.141.86.185 would be routed to 10.0.1.23.

Now we get to the inconsistency of your example.
Your router's external address is 86.212.104.22. All external messages to your private LAN needs to be sent to this router address. I expected the external address for your Directory to be 86.212.104.22:PortA and the Server to be reached at 86.212.104.22:PortB. You would have to set up the port mapping table.

Unfortunately this requires a discussion about routing tables and port mapping. Are you on a path for a different solution?
I believe the desired solution needs to be invisible to the client user (meaning the Jamulus client code doesn't need to know anything about the machinery).

@pljones
Copy link
Collaborator Author

pljones commented May 30, 2022

@gene96817 I'm not changing the intended current behaviour, just simplifying the code, as far as I'm aware. If you want to start a discussion on the topic, the discussions area is where you should do it, not during code review.

@gene96817
Copy link

@pljones Thanks for your work. It just wasn't clear to me what you were trying to fix.

@pljones pljones force-pushed the patch/rethink-int-ext-serverlist-entry branch from e7ac4a2 to 9b0b7eb Compare June 3, 2022 11:25
@pljones pljones force-pushed the patch/rethink-int-ext-serverlist-entry branch from 9b0b7eb to 7517f7b Compare June 6, 2022 17:37
Copy link
Member

@hoffie hoffie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane to me.

--port sets the port the server listens to locally
--serverbindip sets the IP the server listens to locally
--serverpublicip sets the public IP where server and directory are on the same LAN
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
--serverpublicip sets the public IP where server and directory are on the same LAN
--serverpublicip sets the public IP when server and directory are on the same LAN

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Short for "in the situation where" but I guess "when" works... I'll think about it :)

Copy link
Member

@softins softins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ok. I've studied it for a while, and compiled it, but I don't currently have time to run any test cases.

@ann0see ann0see merged commit 8a40e03 into jamulussoftware:master Jun 14, 2022
@pljones pljones deleted the patch/rethink-int-ext-serverlist-entry branch June 14, 2022 16:06
@hoffie hoffie added this to the Release 3.9.0 milestone Jun 18, 2022
@ann0see
Copy link
Member

ann0see commented Jul 25, 2022

I think the Changelog entry should be made a bit clearer (what would an interested user want to read? What has changed? What is being handled?)

@pljones
Copy link
Collaborator Author

pljones commented Jul 26, 2022

Hopefully nothing has changed. It's to make the code clearer. So it's aimed purely at someone reading the code. Really only smoeone looking at the diff would be interested.

@ann0see
Copy link
Member

ann0see commented Jul 26, 2022

Then the changelog should also say "clarify" and "Code"

Refactoring: Clarify handling of requests for the server list in code

Or similar

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

Successfully merging this pull request may close these issues.

5 participants