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

Determine the actual used local address with ENET socket #387

Merged
merged 4 commits into from
Aug 13, 2023

Conversation

jmlee337
Copy link
Contributor

@jmlee337 jmlee337 commented Jul 5, 2023

tested this switching between wifi, ethernet, and VPN

}
}

if (SConfig::GetInstance().m_slippiForceLanIp)
Copy link
Member

Choose a reason for hiding this comment

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

You're confident enough this will work for everyone to remove the override?

Copy link
Contributor Author

@jmlee337 jmlee337 Jul 5, 2023

Choose a reason for hiding this comment

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

I moved this block to the top (line 363) to make the priority order more clear (override > new determination mechanism > fallback old determination mechanism)

// Fetch the last IP (because that was correct for me, not sure if it will be for all)
int i = 0;
while (host_entry->h_addr_list[i] != 0)
// Fallback: just try the last local IP address listed. They seem to be
Copy link
Member

Choose a reason for hiding this comment

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

I feel like all of the local address stuff might as well be moved to its own function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to leave the old determination method alone to have a nicer diff but it didn't work out I guess. You want me to move just this old block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cleaned up the fallback method a bit and factored it out to a separate method. good call looks a lot nicer now imo

Copy link
Member

@NikhilNarayana NikhilNarayana left a comment

Choose a reason for hiding this comment

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

improves the local address fetching on linux; tested on all three OSes with no issues

@NikhilNarayana NikhilNarayana changed the title Determine the actual used local address Determine the actual used local address with ENET socket Aug 13, 2023
@NikhilNarayana NikhilNarayana merged commit e39fe60 into project-slippi:slippi Aug 13, 2023
8 checks passed
rapito pushed a commit to rapito/Ishiiruka that referenced this pull request Aug 31, 2023
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.

3 participants