-
Notifications
You must be signed in to change notification settings - Fork 757
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
Problem with matchLangIP primitive: boost seems to give wrong hostname #1950
Comments
In testing a different issue, I noticed that an Ubuntu machine always returns false for this. Will investigate further. On OSX btw, I've only encountered the problem on one wifi network. (Unfortunately at a cottage where I was staying, so not able to retest) |
Okay, after doing a little research, it seems that this is actually impossible to get a list of local IP addresses in a cross-platform way. I'm not sure why boost::asio doesn't provide this functionality, but unless someone has a better idea I'm going to proceed with a multiple approach, probably with getifaddrs for linux and Mac, etc., and GetAdapterAddresses on Windows. @bagong if you could help me test the latter, I'd be grateful, as I have no Windows machine here. |
Just FYI, on the Ubuntu machine it only returns 127.0.1.1. |
Does #1972 address this issue ? If so this can be closed. |
Just to check, @muellmusik this does fix the issue? |
should have |
So I'm getting a problem with the matchLangIP primitive. It seems that under some circumstances
boost::asio::ip::host_name()
returns the wrong value?with wifi off
hostname()
returns "Scott.local" and all works as expected (returns true or false as appropriate)on the wifi network where I'm currently sat,
hostname()
returns "Scott" and throws an exception atboost::asio::ip::udp::resolver::iterator it=resolver.resolve(query);
. Here's the dump:If I hardcode in "Scott.local" as the hostname it works correctly on the wifi network.
Any ideas how this can be solved or what the issue is? @timblechmann if you have any boost fu to offer that would be much appreciated!
The text was updated successfully, but these errors were encountered: