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
Bugfix Ping.cs #3949
Bugfix Ping.cs #3949
Conversation
Hello! I'm the build bot for the Mono project. I need approval from a Mono team member to build this pull request. A team member should reply with "approve" to approve a build of this pull request, "whitelist" to whitelist this and all future pull requests from this contributor, or "build" to explicitly request a build, even if one has already been done. Contributors can ignore this message. |
Hi @jogibear9988, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! The agreement was validated by .NET Foundation and real humans are currently evaluating your PR. TTYL, DNFBOT; |
@@ -215,7 +215,7 @@ static IPAddress GetNonLoopbackIP () | |||
return addr; | |||
#pragma warning restore 618 | |||
|
|||
throw new InvalidOperationException ("Could not resolve non-loopback IP address for localhost"); | |||
return IPAddress.Loopback; |
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 don't know why we need a non-loopback address, but this is not the correct way of fixing it.
You need to modify SendPrivileged() so it doesn't rely on GetNonLoopbackIP().
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've changed the COde
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 also don't know why, and why is the first one found the correct ine? But ping also works when I add 127.0.0.1 to hosts, so I thought this is ok.
When I look again on this, I think the whole Code is wrong! We need the IP wich was used for send, and not the first one with correct hostname. |
seems like netcore does not need this https://github.com/dotnet/corefx/blob/master/src/System.Net.Ping/src/System/Net/NetworkInformation/Ping.Unix.cs |
Yeah, the corefx code looks better in that regard. You can try porting the relevant pieces. |
I will try to use the corefx code. Is it not planed to migrate a this Assembly in Mono? Which Editor can I use? I tried with VS2015, but it crashes with the Mono Solution. |
eb2f7a0
to
b7b97d0
Compare
With the new change it does work. And it's the same as in corefx. They also only use the destination IP |
@akoeplinger is the patch so ok? |
@akoeplinger - do i still need to do changes on my patch? |
Should fix : https://bugzilla.xamarin.com/show_bug.cgi?id=42249