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

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

  •  05-07-2023
  •  | 
  •  

質問

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!

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top