Conversation
am11
reviewed
Mar 17, 2024
danmoseley
reviewed
Mar 17, 2024
src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.RawSocket.cs
Outdated
Show resolved
Hide resolved
AustinWise
reviewed
Mar 18, 2024
Member
|
I'll take a look at this, tomorrow. |
liveans
approved these changes
Apr 11, 2024
Member
liveans
left a comment
There was a problem hiding this comment.
LGTM, do you think is there an easy way to add a test for it?
am11
reviewed
Apr 11, 2024
| SocketConfig socketConfig = GetSocketConfig(address, buffer, timeout, options); | ||
| using (Socket socket = GetRawSocket(socketConfig)) | ||
| { | ||
| Span<byte> socketAddress = stackalloc byte[SocketAddress.GetMaximumAddressSize(address.AddressFamily)]; |
Member
There was a problem hiding this comment.
nit: move this just before its first usage, at line 288.
Member
Author
There was a problem hiding this comment.
Ping.RawSocket.cs(287,48): error CS0255: stackalloc may not be used in a catch or finally block
This was referenced Apr 15, 2024
Closed
Closed
Member
Author
|
all test failures are known issues. |
This was referenced Apr 16, 2024
Member
Author
|
all test failures are known issues. |
matouskozak
pushed a commit
to matouskozak/runtime
that referenced
this pull request
Apr 30, 2024
* fix ping with TTL on Linux * feedback * feedback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #73232 and #99838.
This was very old regression caused by dotnet/corefx#34084.
While calling
Connecton the socket fixes the problem of receiving unrelated messages it also prevents receiving ICMP from intermediate notes as @filipnavara noticed in #73232 (comment).We could revert the change and implement additional filtering. However it is convenient to let Kernel do it (and work just fine on macOS & FreeBSD). So this change subscribes explicitly to error message and it receives additional information via
struct sock_extended_err.Before the change simple trace route:
and
e.g. the raw socket implementation did not work. With the fix I get same result.
I don;t have IPv6 connectivity to test IPv6. But nothing in the new code seems IPv4 specific.