Skip to content

Class Ping not reading response when ICMP Time-to-live exceeded #61465

Closed
@lorenzo93

Description

@lorenzo93

Description

Hi,
I've wrote a small program to run traceroutes, based on the Ping (System.Net.NetworkInformation) class.
The software works like a charm on Windows but if I execute the same code on a MacOS it does not give the IP addresses of the returned ICMP Time-to-live exceeded messages.

I've already tried to run my software from my user account and from the root account (using sudo) without any luck.

Reproduction Steps

I've used a simple code that is based on the System.Net.NetworkInformation.Ping class and uses the SendPingAsync function.
I specify a PingOptions class to manually set the TTL.

Expected behavior

The PingReply class returned should have the Address property set with the correct IP Address.

Actual behavior

The PingReply class returned has the IP Address set to "0.0.0.0".

Regression?

I've tried the code on .NET 5.0 and on .NET 6.0.
With both versions on Windows is perfectly working while on MacOS it gives the bug.

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions