>      char* dummy_data = (char*)mallocx(12);
 >      for(int i =0 ; i<12;i++)
 >          dummy_data[i]= '2';
 >      
 >      while(1){
 >          lwip_sendto(socket_index,(void*)dummy_data,12,0,(struct
sockaddr*)endpoint,addrlen);
 >          WaitForSingleObject(suspend_udp,SMX_MSEC_TO_TICKS(10)); 
 >      }
 >  }
 
Just found an error there: you initialize each element of dummy_data
with '2', but your ethereal trace shows all frames to contain 12 bytes
of 0x00! This probably means the checksum was calculated based on the
'2', but it didn't get sent, which results in a wrong checksum (since
it's the wrong data which is received).
 
Again, there is a significant difference between TCP and UDP in lwIP
here: TCP packets are (when using the socket API) always delivered in
one piece to the network driver (one single pbuf), while UDP packets are
(again when using the socket API) _always_ delivered as a chain of 2
pbufs: 1 for the headers and 1 for the actual data (since this directly
points to the application buffer). It seems you didn't copy the second
pbuf!
 
Simon
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to