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

netcode.io connect tokens fail when letting the system assign a server port. #93

Closed
maxweisel opened this issue Jan 27, 2020 · 2 comments

Comments

@maxweisel
Copy link
Contributor

maxweisel commented Jan 27, 2020

Steps to reproduce:

  1. Set log level to DEBUG
  2. Create a netcode server, initialize with a valid IP, but a port of 0 (system should assign)
  3. Ask the netcode server to generate a connect token.
  4. Use the connect token to connect to the server.
  5. netcode server binds to a port correctly, and even generates connect tokens that include the assigned port. However, netcode server logs: server ignored connection request. server address not in connect token whitelist

I found this log in netcode here:
https://github.com/networkprotocol/netcode.io/blob/master/netcode.c#L4245

If I add a log to netcode_address_equal that uses netcode_address_to_string to print the addresses, I get something like this:

netcode_address_equal: '1.2.3.4' '1.2.3.4:49315'

Essentially, the connect token sent to the client includes the port assigned to the server by the system, however, server->address still references the netcode_address without the port assignment.

I'm happy to make a patch, but I don't understand how the connect token is getting an address with the valid port, but server->address doesn't include it.

Max

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