Is it correct when ping.Result.Options.DontFragment gives false when sent true?

StackOverflow https://stackoverflow.com/questions/23150936

  •  05-07-2023
  •  | 
  •  

Question

I use:

pingOptions.DontFragment = true;

but in result:

pingTask.Result.Options.DontFragment.ToString()

I get the value is false. I checked code several Times. Is it normal behaviour? Thanks in advance!

Was it helpful?

Solution

Yes the PingReply class provides information from the resulting Send or SendAsync call. So it is the reply of the Endpoint. Because you set DontFragment it doesn't mean that the Endpoint should do that too:

The DontFragment value specified in the ICMP echo request controls packet fragmentation. If DontFragment is true and the packet size exceeds the maximum transmission unit of the network path taken by the packet, the packet is discarded and the PacketTooBig error is returned.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top