Oh, I assumed that the way TCP and UDP handles pbufs are the same. And since
DHCP works fine and it didnt
work with the socket API, your explanation fits in just nicely. But where is
this copying supposed to be done ?
Is it supposed to be done in the socket layer, or netconn API layer? Thanks in
advance again...
Subject: RE: [lwip-users] udp checksum errorDate: Thu, 17 Jan 2008 12:59:32
+0100From: [EMAIL PROTECTED]: [email protected]
> 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
_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users