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