-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Fix parsing the output of ping
on Samsung phones
#80133
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsWhile investigating #78990 I noticed that some Android installations contain a
|
@@ -15,6 +15,8 @@ namespace System.Net.NetworkInformation | |||
{ | |||
public partial class Ping | |||
{ | |||
private static char[] s_ttlExceededAddressSeparators = new[] { ' ', ':' }; |
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.
How would this work for IPv6?
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.
If I understand it correctly, we only use this for the IPv4 ping, not for the IPv6. The v6 output format is From 2a01:4f8:0:e172::1801 icmp_seq=1 Time exceeded: Hop limit
and so the check on line 131/133 will exit early.
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.
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.
LGTM
src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.PingUtility.cs
Outdated
Show resolved
Hide resolved
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.
Is there a test we can/should add for this?
Thanks.
@stephentoub I wanted to add a test that would cover this specific bug but I can't see a good way to achieve it without refactoring the |
let's backport this to 7.0 at least |
/backport to release/7.0 |
Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3893890251 |
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/3913531892 |
@simonrozsival backporting to release/6.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Account for different formats of ping output
Using index info to reconstruct a base tree...
M src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.PingUtility.cs
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.PingUtility.cs
CONFLICT (content): Merge conflict in src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.PingUtility.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Account for different formats of ping output
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@simonrozsival an error occurred while backporting to release/6.0, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
Fixes #78990
While investigating #78990 I noticed that some Android installations contain a
ping
utility that produces slightly different output when ttl is exceeded from what our code expects. This seems to be the case at least on Samsung phones. This PR updates the parser to account for this variation.