dotnet / dotnet/dotnet-api-docs
Ping behaviour on linux not documented (raw socket vs command)
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
# Ping behaviour on linux not documented (raw socket vs command)
Using `System.Net.NetworkInformation.Ping` class on linux can either use raw sockets, or `ping` command line utility as fallback when the current user does not have enough privileges.
The code is here : https://github.com/dotnet/corefx/blob/master/src/System.Net.Ping/src/System/Net/NetworkInformation/Ping.Unix.cs#L154
The documentation does not mention this (I hope I didn't missed it) : https://docs.microsoft.com/fr-fr/dotnet/api/system.net.networkinformation.ping?view=netstandard-2.0
Personally I expected it to fail without being `root`. I was surprised by the behaviour, and searched the explanation in the source code.
Someone could argue it's just an implementation detail, but as it could lead to severe performance problem when used *massively* it's important to be clear. And as the command line could not be always available it could also lead to different behaviour according to the execution environment (eg: full system vs container).
Contributor guide
Assessment
This issue has not been assessed yet.