-
Notifications
You must be signed in to change notification settings - Fork 142
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
Conversation
} | ||
} | ||
|
||
if (SConfig::GetInstance().m_slippiForceLanIp) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
7bac72a
to
9c2587a
Compare
There was a problem hiding this 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
tested this switching between wifi, ethernet, and VPN