sendto() failed (10040)

I

Intaek Lim

I'm writing a simple path MTU discovery utility by modifying
'traceroute' source code in Win32 with MSVC7.

I set DF bit in IP header and send packets filled with N bytes of
data. When MTU size of some intermediate router is less than the size
of packet I sent, then that router returns 'Packet needs to be
fragmented but DF set' error. So I try again with packets those are
smaller than previous packets, again and again.

Okay, I can find path MTU in this way, but there is a problem.
After I receive DF error from router, in next try, sendto() don't
work. WSAGetLastError() returns 10040(message too long).
Does windows socket library remember information like 'Host - Path MTU
to the HOST'? If not, why sendto fails? I cleaned up socket resources
right before exit point of my program.
 
V

Victor Bazarov

Intaek said:
I'm writing a simple path MTU discovery utility by modifying
'traceroute' source code in Win32 with MSVC7.

I set DF bit in IP header and send packets filled with N bytes of
data. When MTU size of some intermediate router is less than the size
of packet I sent, then that router returns 'Packet needs to be
fragmented but DF set' error. So I try again with packets those are
smaller than previous packets, again and again.

Okay, I can find path MTU in this way, but there is a problem.
After I receive DF error from router, in next try, sendto() don't
work. WSAGetLastError() returns 10040(message too long).
Does windows socket library remember information like 'Host - Path MTU
to the HOST'? If not, why sendto fails? I cleaned up socket resources
right before exit point of my program.

Is there a C++ _language_ question I am not seeing? So far all it is
about is "windows socket library". Please go to the relevant newsgroup
for that, 'comp.os.ms-windows.programmer.win32'.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top